PDA

View Full Version : php Upload


street_spirit
10-15-2007, 12:05 PM
Hi I am trying to get a simple php upload script working, just learning PHP not for anything usable yet. I was going through the tutorials at w3c school and then tried the following tutorial: http://php.about.com/od/advancedphp/ss/php_file_upload.htm

I think the problem I am having is a permission one for the folder I am trying to upload to. At the moment I just have the upload folder pointing to the folder I have put the upload php script in; which is the www folder.

I went into the file manager and made the folder its in writable to group and world which then brought up a page about security risk when I tried to use the php upload script. Any ideas how get the permissions right?

felgall
10-15-2007, 01:43 PM
Whatever folder you configure to allow file uploads to will be a security risk because you will have to include all the code to test that only appropriate files can be uploaded in the code you write yourself. I suggest that you get a thorough knowledge of PHP security before setting it up since if someone manages to upload certain types of file it can cause problems for the entire server.

street_spirit
10-15-2007, 02:07 PM
yep, the script I am playing with only lets you upload GIF files under 300kb or something like that.

felgall
10-15-2007, 03:06 PM
That should be safe enough provided that the script doesn't contain any security holes.