Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old April 12th, 2007, 08:25 PM
just_me
Guest
 
Posts: n/a
Default 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.

  #2  
Old April 12th, 2007, 08:55 PM
Erwin Moller
Guest
 
Posts: n/a
Default Re: move_uploaded_file() problem.

just_me wrote:
Quote:
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
  #3  
Old April 13th, 2007, 09:35 AM
Schraalhans Keukenmeester
Guest
 
Posts: n/a
Default Re: move_uploaded_file() problem.

just_me wrote:
Quote:
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.

 

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles