Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/229.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 下载提示仅在iOS中不起作用_Php_Ios - Fatal编程技术网

Php 下载提示仅在iOS中不起作用

Php 下载提示仅在iOS中不起作用,php,ios,Php,Ios,这将启动一个.jpg下载提示,就像我希望它做的那样,但仅在Windows和Android上。在iOS上,它只显示一个小正方形,什么也没发生 有什么建议吗?Hi,你能介绍一下你在什么浏览器上测试过这个吗?这段代码不正确filesize(“http://www.example.com/“$url)它只适用于本地文件。我还认为您的文件名周围需要双引号。您好,您能包括哪些浏览器吗您在上进行了测试?此代码不正确文件大小(“http://www.example.com/“$url)它只适用于本地文件我还认为

这将启动一个.jpg下载提示,就像我希望它做的那样,但仅在Windows和Android上。在iOS上,它只显示一个小正方形,什么也没发生


有什么建议吗?

Hi,你能介绍一下你在什么浏览器上测试过这个吗?这段代码不正确
filesize(“http://www.example.com/“$url)
它只适用于本地文件。我还认为您的文件名周围需要双引号。您好,您能包括哪些浏览器吗您在上进行了测试?此代码不正确
文件大小(“http://www.example.com/“$url)
它只适用于本地文件我还认为文件名周围需要双引号
<?PHP
    $filenames=explode("/",$_GET['q']);
    $filename=end($filenames);
    $url = $_GET['q'];

    header('Content-Description: File Transfer');
    header('Content-Type: image/jpeg');
    header('Content-Disposition: attachment; filename='.$filename);
    header('Content-length: ' . filesize("http://www.example.com/".$url));

    echo file_get_contents("http://www.example.com/".$url);
?>