fanfavorite Posted September 3, 2008 Share Posted September 3, 2008 I was just wondering what the best method is of protecting documents like mp3's, pdf's, etc. Basically I am creating a shopping cart that at the end allows them to download what they are purchasing. What I was thinking was that I would use .htaccess to password protect the folder and use curl through the cart to automatically login to download the files. Is this the best and secure way or is there another way of doing this? Please let me know. Thanks. Link to comment https://forums.phpfreaks.com/topic/122537-solved-protecting-documents/ Share on other sites More sharing options...
Prismatic Posted September 3, 2008 Share Posted September 3, 2008 The best way would be to create a download file that checks to see if someone's authorized to access the file and then stream it through that php file to the end user. If you keep the files outside of the webroot they wont be directly accessible from the browser either. Link to comment https://forums.phpfreaks.com/topic/122537-solved-protecting-documents/#findComment-632789 Share on other sites More sharing options...
fanfavorite Posted September 3, 2008 Author Share Posted September 3, 2008 Makes sense. Then just use fget to download the file. Thanks for the help. Link to comment https://forums.phpfreaks.com/topic/122537-solved-protecting-documents/#findComment-632809 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.