Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/244.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
移动设备上的PHP下载超时问题_Php_Download_Apache2 - Fatal编程技术网

移动设备上的PHP下载超时问题

移动设备上的PHP下载超时问题,php,download,apache2,Php,Download,Apache2,遗憾的是,我的PHP下载脚本出现了问题 首先,通过Get变量调用文件 然后脚本搜索大小、类型并将其下载 在我的电脑上,使用Chrome,一切都很有魅力。 但是,当我尝试使用Safari在iPhone上下载文件时,它只加载图片的一些像素,然后停止,因为网络连接被中断:// if(file_exists($file_url) OR @getimagesize($file_url)) { $size = $row['size'] * 1024; // Dateigröße in Byte um

遗憾的是,我的PHP下载脚本出现了问题
首先,通过Get变量调用文件
然后脚本搜索大小、类型并将其下载
在我的电脑上,使用Chrome,一切都很有魅力。
但是,当我尝试使用Safari在iPhone上下载文件时,它只加载图片的一些像素,然后停止,因为网络连接被中断://

if(file_exists($file_url) OR @getimagesize($file_url))     {
$size = $row['size'] * 1024; // Dateigröße in Byte umrechnen
header("Content-Type: $type");
header('Content-disposition: attachment; filename="'.$file.'"');
header("Content-Length: ". $size);
header("Content-Transfer-Encoding: binary");
//ob_clean();
ob_end_clean();
flush();
readfile($file_url);
我做错什么了吗


提前谢谢

为什么不先启动ob?编辑:将立即尝试。很遗憾,这并没有改变什么。该文件仍处于挂起状态,为完整大小的90%。几秒钟后,它就完全完成了(但就在我的电脑上),我想知道你的图像大小是否有误。是否有$row['size']实际大小?此文件保存在mysql中的大小为109(KB)。通过将其乘以1024,我将其转换回字节。