使用php进行文件的下载。
$fsize = filesize($newUrl);
header("Content-Type: application/octet-stream;");此处octet-stream后面的;号一定加上,否则会出现“下载提示:无法复制 文件:无法读源文件或磁盘”的错误。
//fread($file,$filesize);
header("Content-Disposition: attachment; filename=basename($zipfilename));
//header("Location: archive.zip");
header("Content-Length: $fsize");
//$fp = fopen("$zipfilename", "rb");
//fpassthru($fp);
//fclose($file);
readfile("$zipfilename");