How to download files with hidden actual address by php
This article mainly introduces php how to hide the actual address of the file download, has a certain reference value, interested friends can refer to, I hope you can learn a lot after reading this article, the following let the editor take you to understand it.
The details are as follows:
The following php code does not reveal the actual download address of the file.
Function download_document ($filename,$path= ", $mimetype=" application/octet-stream ") {header (" Cache-Control: must-revalidate, post-check=0, pre-check=0 "); header (" Content-Disposition: attachment; filename = $filename "); header (" Content-Length: ". Filesize ($pathto. $filename); header ("Content-Type: $mimetype"); echo file_get_contents ($pathto. $filename);}
Implementation method 2:
Thank you for reading this article carefully. I hope the article "how to download files with hidden actual addresses in php" shared by the editor will be helpful to everyone. At the same time, I also hope that you will support and pay attention to the industry information channel. More related knowledge is waiting for you to learn!