index-uplog.php 819 B

12345678910111213141516171819202122232425
  1. <?php
  2. // by 请勿倒卖,已申请软著,否则追究法律责任
  3. include "../../system/db.class.php";
  4. include "../../system/user.php";
  5. $GLOBALS["userlogined"] || exit("-1");
  6. Chk_authkey();
  7. $time = SafeRequest("time", "post");
  8. if (!empty($_FILES)) {
  9. $filename = $_FILES["app"]["name"];
  10. $filepart = pathinfo($filename);
  11. $extension = strtolower($filepart["extension"]);
  12. if (in_array($extension, array("ipa", "apk", "mobileconfig"))) {
  13. preg_match("/^(\\d+\\-\\d+)\$/", $time) || exit("-1");
  14. $dir = IN_ROOT . "data/tmp/" . $time . "/";
  15. if (!is_dir($dir)) {
  16. @mkdir($dir, 0777, true);
  17. }
  18. $file = $dir . "app." . $extension;
  19. @move_uploaded_file($_FILES["app"]["tmp_name"], $file);
  20. echo "{'extension':'" . $extension . "','time':'" . $time . "','filename':'" . $filename . "'}";
  21. } else {
  22. echo "-1";
  23. }
  24. }