Php downloading code is not easy to use in Apple! PHPcode $ filefopen ($ filename, & quot; r & quot;); Header (& quot; Content-type: applicationoctet-stream & quot;); Header (& quot; accept-Ranges: bytes & quot;); php download code, which is not easy to use in Apple!
PHP code
$file = fopen($filename, "r ");Header( "Content-type: application/octet-stream ");Header( "Accept-Ranges: bytes ");Header( "Accept-Length:".filesize($filename));Header( "Content-Disposition:attachment;filename= ".$filename);echo fread($file,filesize($filename));fclose($file);
At the beginning, I directly output the content to the page. Later I found another function.
PHP code
function download_file($archivo, $downloadfilename = null) { if (file_exists($archivo)) { $downloadfilename = $downloadfilename !== null ? $downloadfilename : basename($archivo); header('Content-Description: File Transfer'); header('Content-Type: application/octet-stream'); header('Content-Disposition: attachment; filename=' . $downloadfilename); header('Content-Transfer-Encoding: binary'); header('Expires: 0'); header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); header('Pragma: public'); header('Content-Length: ' . filesize($archivo)); ob_clean(); flush(); readfile($archivo); exit; } }
The effect is the same. please solve it!
The following is a conversation between me and a person:
Just give the resource address to Apple's interface.
Question
That is to say, directly set the link address as the file address, right! I tried it. The Download box is not displayed, and the page is directly output!
Answer
I have just asked about the mobile phone group. Apple's operating system is different from windows. it has no permission to download things. even if it can download things, Apple will not allocate you a bucket to store resources. Apple only recognizes applications and allocates a certain amount of storage space to applications. to allow Apple to download resources, go through the application channel.
Question
But I usually use Apple's operating system to download things! The download prompt box is displayed when you click download on the Internet! However, you are not sure what operating system the website server uses. Do you mean that the Apple server does not provide download? Is it true that all websites that use Apple as servers do not have the download function?
------ Solution --------------------
Discussion
PHP code
$ File = fopen ($ filename, "r ");
Header ("Content-type: application/octet-stream ");
Header ("Accept-Ranges: bytes ");
Header ("Accept-Length:". filesize ($ filename ));
Header ("Content ......
------ Solution --------------------
Discussion
Browser can download http://www.duote.com/soft/2054.html on this page click download can pop up the download box!
------ Solution --------------------
Are these parameters useful?
Http://apps.hi.baidu.com/share/detail/35570157
Http://blog.csdn.net/starzxf/article/details/6746876
Http://iask.sina.com.cn/ B /6263205