Jump to content

[SOLVED] Protecting Documents


fanfavorite

Recommended Posts

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

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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.