FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


File upload error





richard270384
Hi,

I have a script to upload images to my website. I just changed servers and it worked on the old server, but doesn't work on the new server.

THe script has not changed at all.

I'm assuming that it must be something in the config of the new server.

The errors I am getting are:

Code:

Warning: move_uploaded_file(../temp/220.jpg) [function.move-uploaded-file]: failed to open stream: Permission denied in /home2/mwhiz/public_html/members/upload.php on line 61

Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move '/tmp/phpYfjEil' to '../temp/220.jpg' in /home2/mwhiz/public_html/members/upload.php on line 61
An error occurred while uploading.


Does anybody know what php setting or anything else could be affecting my script?

Cheers,
Richard
imagefree
it is may be because you dont have sufficient rights on the new host or file uploading may be restricted. (its just a guess. I am too looking forward for the solution.)
Diablosblizz
Quote:

Warning: move_uploaded_file(../temp/220.jpg) [function.move-uploaded-file]: failed to open stream: Permission denied in /home2/mwhiz/public_html/members/upload.php on line 61


Well, this means that the move_uploaded_file function didn't have permission to move the file on the new server. Did you CMHOD the files correctly on the new server? (it will NOT bring the file permissions along with you)
alalex
just throw in the directory a .htaccess file, and add permissions so that you can write in that directory.. if the problem keeps appearing then post it here.. Wink
richard270384
Havent had a chance to test the chmod suggestion yet.

WHen I do I will let you know how I went.
richard270384
Silly me,

All I had to do was chmod the "temp" folder (just the once).
Diablosblizz
So, everything is working okay now?
richard270384
Yeah. Every thing works fine now!
Related topics
File upload with PHP, Build an upload database for your site
File Upload from webpage failing
quite simple file upload
nt set output/error file
File upload problem :'(
[RESOLVED] php file upload problem
File upload class problem.
File upload
Looking for file upload!
I see the old pages even after uploding the new one (plz hlp
upload form
Bulk file upload
Upload Error 500
Joomla config file write error 500
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.