android浏览器附件下载问题
服务器端是php写的电脑上下载一切OK, IE,chrome都没问题
android自带浏览器不会下载,而是直接以文本方式打开了,乱码
android chrome会下载,但下载时显示“未命名文件”,下载好后文件名为attach.php,把它重名为正确的文件名后可以正常打开,说明下载的文件本身是正确的。
这可咋办呢?怎么让android浏览器以附件下载,并且文件名正确呢?
有人遇到过类似情况吗?
附:attach.php 主要代码
ob_end_clean( );
header('Content-Type: text/html; charset=utf-8');
header( "Content-type: application/octet-stream" );
header( "Accept-Ranges: bytes" );
header( "Accept-Length: ".filesize( $URL ) );
header("Content-Type: application/force-download");
header("Content-Transfer-Encoding: binary");
$encoded_filename = urlencode($ATTACHMENT_NAME);
header("Content-Disposition: attachment; filename=\"" . $encoded_filename . '"');
readfile( $URL );
补充:移动开发 , Android