Uploading an Image

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
rex3
Forum Newbie
Posts: 1
Joined: Sat Apr 29, 2006 6:17 pm

Uploading an Image

Post 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
User avatar
Benjamin
Site Administrator
Posts: 6935
Joined: Sun May 19, 2002 10:24 pm

Post by Benjamin »

Perhaps changing the owner of the file from root to nobody would solve the problem.
Post Reply