1

Possible Duplicate:
HTTP authentication using PHP authentication

Hi. I'm making a members area for my site and I have it already running. I authenticate members using mysql and php and this works really well.

But now problems occurs, I would like to offer members a possibility to upload files to the systems, and those files should be available ONLY to logged in members.

I know I could store those files to a database or even in a filesystem and serve them throught php, BUT this will get very heavy for the server when members upload bigger files. Those files might be even 20MB or even bigger.

4
  • 1
    What exactly is your question here? How to secure access to the files, or how to store them on your server? Commented Jun 18, 2010 at 14:14
  • @Eric, damn, you beat me by 4 seconds! Commented Jun 18, 2010 at 14:15
  • Don't accept sizes over a certain limit? Or upgrade your hosting plan? Commented Jun 18, 2010 at 14:15
  • Or you could try amazon cloud hosting aws.amazon.com/ec2 or your prefered cloud hosting to store the files Commented Jun 18, 2010 at 14:20

1 Answer 1

1

His question is how to make those files unavailable to users who are not authenticated (I supppose).

Storing files themselves in databases is a very bad idea. Just put them in an unaccessible directory (ie: use .htaccess to restric access) and serve them using PHP. The additional load on the server in doing so (if done correctly) is minimal.

Sign up to request clarification or add additional context in comments.

1 Comment

"The additional load on the server in doing so (if done correctly) is minimal." How would one do this correctly?

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.