bunion Posted April 15, 2008 Share Posted April 15, 2008 Hi i have now finished coding a facility which allows the administrator to create password protected private areas on the site. He can upload any type of file to their area. They log in via a php script and a mysql database of users. I have enabled hotlink protection on the control panel to stop outsiders accessing these private files. However once the user logs in i want them to be able to download and view the files. Even if put the file in an iframe on the page, hotlink protection stops it showing or the save as dialogue coming up. I used the simple private user area script template below: http://www.xentrik.net/php/signup/complete.php Any ideas on how to allow access to these files for registered users? Thankyou Link to comment https://forums.phpfreaks.com/topic/101149-show-hotlink-protected-files-to-logged-in-users/ Share on other sites More sharing options...
bunion Posted April 15, 2008 Author Share Posted April 15, 2008 bump Link to comment https://forums.phpfreaks.com/topic/101149-show-hotlink-protected-files-to-logged-in-users/#findComment-517529 Share on other sites More sharing options...
discomatt Posted April 15, 2008 Share Posted April 15, 2008 The easiest way is to store the file outside of webroot and serve it using PHP to authorized users Link to comment https://forums.phpfreaks.com/topic/101149-show-hotlink-protected-files-to-logged-in-users/#findComment-517531 Share on other sites More sharing options...
bunion Posted April 15, 2008 Author Share Posted April 15, 2008 thanks, how would i go about serving it? embed it with an object tag? Link to comment https://forums.phpfreaks.com/topic/101149-show-hotlink-protected-files-to-logged-in-users/#findComment-517544 Share on other sites More sharing options...
discomatt Posted April 15, 2008 Share Posted April 15, 2008 This snippet should help get you started http://elouai.com/force-download.php Link to comment https://forums.phpfreaks.com/topic/101149-show-hotlink-protected-files-to-logged-in-users/#findComment-517548 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.