View Full Version : password protect a file

03-26-2010, 04:37 AM

I would like to use php to allow access to a file only when a person pays me for access. sort of like when you visit a microsoft website and when you download one of their files, they have strange names like "j8eiw098l.exe". can someon point me in the right direction of how to store files in a secure place (as in not accessible by typing in the URL directly), and then provide access to them on a password protected basis?

I know how to password protect a web page content, but that is not the same as protecting a URL to a file directly...

03-26-2010, 03:33 PM
What is the filetype (.mp3, .jpg, .pdf, etc.) ?

You posted in PHP, so I assume you already know you'll use PHP to do this.
It will also involve a lot of other things, like a credit card gateway (for payment),
some IPN transactions (so you know they paid for it).

If you were to install something like CubeCart, you would have all of that already
done for you. It's free, and you can set it to work with tangible items or file