Move uploaded file function help required please

Hello!!

I am very new to PHP, so apologies for my very basic understanding.

I am trying to code a page to upload images onto my server.
There is a problem with the move uploaded file function, here’s the errors I am getting:

Warning: move_uploaded_file(upload/6117.gif) [function.move-uploaded-file]: failed to open stream: Permission denied in /home/smartie/public_html/upload_file.php on line 22

Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move ‘/tmp/phpGyKvCf’ to ‘upload/6117.gif’ in /home/smartie/public_html/upload_file.php on line 22
Stored in: upload/6117.gif

I think I’m having a problem as the PHP files and the folder I have called “upload” are stored within the “public_html” section my web server, whereas the file called “tmp” is not. The file which is called “tmp” is not one I have created myself, it is one that was already there with my web server.

If anyone can help me overcome this problem, I would be very grateful.

I can post the other code used if required.

Thank you!!

It says Permission Denied, which tells me there’s something wrong with the rights you have on the machine. Are you being hosted? If so, I’d say contact your host and tell them about this problem, as they can undoubtedly fix it.

Thank you, I shall try that :)

Sponsor our Newsletter | Privacy Policy | Terms of Service