The article introduces the code to use PHP to read files and download them. PHP must use the header function to download files. You can refer to it.
The code is as follows
|
Copy code
|
||||||||
$file = 'monkey.gif';
flush(); readfile($file);
exit;
}
?>
The above code is the download code
I will post a code for online preview of pdf files
Previous article:Summary of commonly used dates and times in PHP_PHP tutorial
Next article:PHP regular expression extraction image url program
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Articles by Author
Latest Issues
When adding sublime3 to compile system php, use the PHP toolbox, cmd php -v is useless
From 1970-01-01 08:00:00
0
0
0
Related Topics
More>
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
|