Reply
Image upload "Permisssion denied"?
Old 01-28-2005, 08:29 PM Image upload "Permisssion denied"?
SoD
Average Talker

Posts: 21
Okay, Ive done an image upload script for my site, but it has an error. It says
"Warning: move_uploaded_file(_images/_screenshots/test.png): failed to open stream: Permission denied in cp.php on line 312

Warning: move_uploaded_file(): Unable to move '/tmp/php4GN21F' to '_images/_screenshots/test.png' in cp.php on line 312"


Anyone know how I can stop this happening? Its really annoying, I need this feature badly.



Thanks
SoD
SoD is offline
Reply With Quote
View Public Profile
 
When You Register, These Ads Go Away!
Old 01-28-2005, 09:36 PM
Anacrusis's Avatar
Defies a Status

Posts: 2,099
Name: Adam
Location: Colchester CT
You need to chmod the _images/_screenshots directory and anything in it to make it writable by everybody. Most modern FTP clients have this capability. If not, your host should be able to do it for you.
Anacrusis is offline
Reply With Quote
View Public Profile Visit Anacrusis's homepage!
 
Old 01-28-2005, 09:50 PM
SoD
Average Talker

Posts: 21
Thanks!! It still gives errors but the permissions are solved now, I can fix the other errors by myself...



Thanks again!
SoD
SoD is offline
Reply With Quote
View Public Profile
 
Old 01-30-2005, 03:14 AM
Logical Program's Avatar
Super Talker

Posts: 130
Location: Atlanta, Georgia
If you want to chmod the files as well after uploading them so you don't incur any permissive errors in the future, do this: (userfile being the name of the field of the uploaded file)

PHP Code:
chmod('directory/of/upload/'.$_FILES['userfile']['name'], 777); 
Put that AFTER the line which runs move_uploaded_file();
__________________
Logical Programming - For all of your website programming and design needs, make the logical choice. Logical Assistance For Real-World Clients.
Logical Program is offline
Reply With Quote
View Public Profile Visit Logical Program's homepage!
 
Reply     « Reply to Image upload "Permisssion denied"?
 

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

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




   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 


Page generated in 0.12341 seconds with 12 queries