PHP:从android浏览器默认下载文件

时间:2013-03-01 06:26:32

标签: php android browser download

我有代码下载文件,例如:

$path = "../wap/file/{$row['file_name']}";
$filename = $row['file_name'];
header("Pragma: public");
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Cache-Control: private",false);
header('Content-Type: application/octetstream');
header("Content-Disposition: attachment; filename=\"$filename\"");
header('Content-Type: application/force-download');
header("Content-Type: application/save");
header("Content-Transfer-Encoding: binary");
header('Content-Description: File Transfer');
header("Content-Disposition: attachment; filename=\"{$row['file_name']}\"");
header('Content-Length: ' . filesize($path));
readfile($path);

当我通过Opera在Android上下载文件时,下载成功。但是如果通过浏览器默认的android下载文件,则下载失败!

0 个答案:

没有答案