Php modifies the header to force image download ,. Php enforces image download by modifying the header. This article describes how php enforces image download by modifying the header. Share it with you for your reference. The specific implementation
Php force download of any file format
Download some files using php. this is generally required to hide the files. Otherwise, it will increase the burden on the server. it is better to provide the software address directly.A simple php file
When the configuration is complete, all files in the access site are forced to download, prompting the download window, including all the files such as Asp,php,txt.
When making an XP theme download station, for example. bootskin files need to be
Php enforces image download by modifying the header. Php forced image download by modifying the header this article mainly introduces php's method of forced image download by modifying the header. The example shows the php forced image download
PHP by modifying the header to force the image download method,
This example describes how PHP enforces the download of images by modifying the header. Share to everyone for your reference. The implementation method is as follows:
function
Sometimes some files cannot be opened online, but need to be downloaded after execution. This function can be used to solve the problem.
The code is as follows:
Function downloadFile ($ file ){/* Coded by Alessio Delmonti */$ File_name = $ file;$
PHP allows you to change the HTTP headers that you write so that you can force a file to be downloaded, typically, the browser will load the files in the same window. This is perfect for documents such as PDF files, document files, pictures, videos
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.