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;$
Because the current browser can recognize the file format in txt, if you just make a text link to the txt file, you may just open a new window to display the content of the txt file, click Download cannot be implemented. Wehavetodosomethingelse. of
Because the current browser can recognize the file format in txt, if you just make a text link to the txt file, you may just open a new window to display the content of the txt file, click Download cannot be implemented. We have to do something else.
The Web site contains more than just web pages, and sometimes you need to provide files that users can download. Putting your files on the server and attaching links to the pages is just the first step, and you also need to be aware that the HTTP
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
Sometimes we want pieces, text documents, Web pages, MP3, PDFs, and so on, when clicked on the corresponding link to download directly, rather than on the page display, then you need to force the header header information. The following is a piece
Computer security is especially important to every computer user. It is absolutely not so careless in choosing security software. Currently, all types of anti-virus software on the market are mixed, making it difficult for users to choose from. In
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.