forked from monkipython/CarService-ServerSide
/
down.php
33 lines (32 loc) · 801 Bytes
/
down.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<?php
ob_start();
if (!isset($_GET["File"])) {
print "no file selsect"; exit();
}
$file =$_GET["File"];
$type = end(explode('.',$file));
if($_GET['usernameModel']=='basename'){
$fileName = null;
}else{
$arrstr = explode('/',$file);
$last = end($arrstr);
$lastarr = explode('.',$last);
// array_pop($lastarr);
$fileName = implode('.',$lastarr);
}
include_once "class.httpdownload.php";
$object = new httpdownload();
$result=$object->set_byfile($file);
if($type =='ipa'){
$object->mime ='.ipa application/iphone-package-archive';
}elseif($type =='apk'){
$object->mime ='.apk application/vnd.android.package-archive';
}else{
}
if(!$result) {
print "下载失败 "; exit();
}
$object->filename = $fileName;
$object->download();
ob_end_flush();
?>