Jump to content

how to protect private file


dogdog9

Recommended Posts

hi ,

 

I need to write a php script to let users to upload files. The uploaded files can be public/private download.

 

For private download, i don't know how to prevent users to download the files directly from my web server. Below is my environment.

 

- Apache 2.0.x, PHP5.2.x, Mysql 5.1.x

- DocumentRoot: /www

 

e.g. if user1 uploaded a "abc.txt" to /www/user1/abc.txt, that is the URL: http://domain1.com/user1/abc.txt. How to prevent unauthorized direct access to this link?

 

I googled and find someone suggests to using "X-SENDFILE" header with Apache mod_xsendfile module. But i can't find detailed description about it. or any other better method?

 

Thanks,

Felix Chu

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.