Uploading/download files safetly?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
zeveck
Forum Newbie
Posts: 15
Joined: Mon Oct 17, 2005 7:23 pm
Location: Mountain View, CA

Uploading/download files safetly?

Post by zeveck »

So, say I am running PHP5 as an apache module under apache2.

I want users to be able to upload files to a directory, and also to be able to download files from that directory, but I only want them to be able to do either using a PHP script. In particular, I do not want users to be able to just enter a URL to download the file. The naive approach is to restrict the permissions on the folder so that apache cannot read from it, but then PHP cannot seem to access it either.

I assume this is a common enough problem, but I am am having trouble searching for results because the search terms (download, file, upload, php, etc.) are too general.

Any advice will be appreciated.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

google "deny from all"
Post Reply