12345678910111213141516171819202122232425 |
- <?php
- // by 请勿倒卖,已申请软著,否则追究法律责任
- include "../../system/db.class.php";
- include "../../system/user.php";
- $GLOBALS["userlogined"] || exit("-1");
- Chk_authkey();
- $time = SafeRequest("time", "post");
- if (!empty($_FILES)) {
- $filename = $_FILES["app"]["name"];
- $filepart = pathinfo($filename);
- $extension = strtolower($filepart["extension"]);
- if (in_array($extension, array("ipa", "apk", "mobileconfig"))) {
- preg_match("/^(\\d+\\-\\d+)\$/", $time) || exit("-1");
- $dir = IN_ROOT . "data/tmp/" . $time . "/";
- if (!is_dir($dir)) {
- @mkdir($dir, 0777, true);
- }
- $file = $dir . "app." . $extension;
- @move_uploaded_file($_FILES["app"]["tmp_name"], $file);
- echo "{'extension':'" . $extension . "','time':'" . $time . "','filename':'" . $filename . "'}";
- } else {
- echo "-1";
- }
- }
|