469,955 Members | 1,878 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,955 developers. It's quick & easy.

move_uploaded_file() problem.

Hello everybody,

I am using move_uploaded_file() in a form to handle image uploading,
and it worked just great when I was testing locally in my computer.
After uploading the file in my host provider I get a warning (not an
error) "Permission denied" to move the temporary file to folder I
want.
Should I email the provider or it's somewhere else the problem?

Any help is welcome!
Thanks a lot for your time, I appreciate that.

Apr 12 '07 #1
2 2227
just_me wrote:
Hello everybody,

I am using move_uploaded_file() in a form to handle image uploading,
and it worked just great when I was testing locally in my computer.
After uploading the file in my host provider I get a warning (not an
error) "Permission denied" to move the temporary file to folder I
want.
Should I email the provider or it's somewhere else the problem?

Any help is welcome!
Thanks a lot for your time, I appreciate that.

Hi,

The folder your are moving to is the problem.
That folder needs to be writable for the user that runs PHP.

If you are on Linux, that user is often named www-data, or nobody, or
Apache.
If you are silly and run W$ OS with IIS as webserver, the user is named:
IUSR_<machinename>

Just make sure they may write in your targetfolder and your are fine.

Good luck!

Regards,
Erwin Moller
Apr 12 '07 #2
just_me wrote:
Hello everybody,

I am using move_uploaded_file() in a form to handle image uploading,
and it worked just great when I was testing locally in my computer.
After uploading the file in my host provider I get a warning (not an
error) "Permission denied" to move the temporary file to folder I
want.
Should I email the provider or it's somewhere else the problem?

Any help is welcome!
Thanks a lot for your time, I appreciate that.
In addition to Erwin's reply, in my case the open_basedir restriction
added to the problem: the 'final' upload folder should be one 'under'
the basedir, if it's set at all of course.

If open_basedir is set to a dir under the wwwroot a security concern
arises: since the apache server has to be able to write in the dir, in
principle ANY server-parsed script run on the machine can
write/read/modify/delete stuff in the dir.

Sh.

Apr 13 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by neo002244 | last post: by
1 post views Thread by Paul Lamonby | last post: by
1 post views Thread by Felix Natter | last post: by
6 posts views Thread by Stijn Goris | last post: by
2 posts views Thread by Brian | last post: by
5 posts views Thread by bill | last post: by
7 posts views Thread by nicemotion | last post: by
3 posts views Thread by groupie | last post: by
1 post views Thread by Sebzzz | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.