web_master Posted May 19, 2008 Share Posted May 19, 2008 hi, is there some possibility to hide destination of the downloadable file with PHP? thanx Link to comment https://forums.phpfreaks.com/topic/106281-hide-destination-of-the-downloadable-file/ Share on other sites More sharing options...
MadTechie Posted May 19, 2008 Share Posted May 19, 2008 put the files in a hidden folder or a folder outside of the public_html folder. ie /hidden_path/myfile.jpg now a simple script (used ober's force download as a base) <?php $file = "/hidden_path/".$_REQUEST['file']; header("Pragma: public"); header("Expires: 0"); header("Cache-Control: must-revalidate, post-check=0, pre-check=0"); header("Content-Type: application/force-download"); header( "Content-Disposition: attachment; filename=".basename($file)); header( "Content-Description: File Transfer"); @readfile($file); ?> Link to comment https://forums.phpfreaks.com/topic/106281-hide-destination-of-the-downloadable-file/#findComment-544714 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.