Page 1 of 1

Uploading an Image

Posted: Sat Apr 29, 2006 6:25 pm
by rex3
Problem: Every time I upload an image via my php script (form) to a folder, i have to chmod (777) the folder before i upload the image. Then I have to chmod (755) it again after i upload it via the form.

The file structure:

The submitting script:
root / intuts / submit.php

The folder that takes in the images:
root / tutimg /


I have used chmod in my script before, but there is a problem that occures which says operation not permitted. Before some one can use the php chmod function do you have to change the owner to make it super so that chmod can work? please help. also when chmoding would the function in the submit.php script work like this:

chmod ("../tutimg", 0777); //<- that query is more to do with the path, as im not good with unix

please help thank you very much

Posted: Sat Apr 29, 2006 6:39 pm
by Benjamin
Perhaps changing the owner of the file from root to nobody would solve the problem.