12345678910111213141516171819202122 |
- <?php
- // by 请勿倒卖,已申请软著,否则追究法律责任
- include "../../../system/db.class.php";
- db("salt")->where("in_time", "<", strtotime("-60 seconds"))->delete();
- $proxy = explode("/", isset($_SERVER["PATH_INFO"]) ? $_SERVER["PATH_INFO"] : NULL);
- $base = isset($proxy[1]) ? $proxy[1] : NULL;
- $salt = SafeSql(str_replace(array(".ipa", ".apk"), array("", ""), $base));
- $id = db("salt")->where("in_salt", $salt)->value("in_aid");
- $id || exit("Access denied");
- $app = db("appid")->where("in_id", $id)->find();
- $size = filesize(IN_ROOT . "./data/attachment/" . $app["in_app"]);
- header("Cache-Control: private");
- header("Content-Type: application/octet-stream");
- header("Content-Disposition: attachment; filename=" . $app["in_originalName"]);
- header("Content-Transfer-Encoding:binary");
- header("Accept-Ranges: bytes");
- header("Expires:0");
- header("Cache-Control:must-revalidate");
- header("Pragma:public");
- header("Content-Length: " . $size);
- readfile(getapp($id, 1));
|