annaaddictive Posted May 4, 2007 Share Posted May 4, 2007 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!! Link to comment https://forums.phpfreaks.com/topic/50014-move-uploaded-file-function-help-required-please/ Share on other sites More sharing options...
zzman Posted May 4, 2007 Share Posted May 4, 2007 make sure apache has Read/write access to that folder. Link to comment https://forums.phpfreaks.com/topic/50014-move-uploaded-file-function-help-required-please/#findComment-245506 Share on other sites More sharing options...
neel_basu Posted May 4, 2007 Share Posted May 4, 2007 I am quite sure about it that the Directory Permisson is not 777 make it 777 and it will work. Link to comment https://forums.phpfreaks.com/topic/50014-move-uploaded-file-function-help-required-please/#findComment-245509 Share on other sites More sharing options...
zzman Posted May 4, 2007 Share Posted May 4, 2007 It doesn't have to be 777, thats a security risk. Link to comment https://forums.phpfreaks.com/topic/50014-move-uploaded-file-function-help-required-please/#findComment-245535 Share on other sites More sharing options...
neel_basu Posted May 4, 2007 Share Posted May 4, 2007 So whats the current chmod ?? Link to comment https://forums.phpfreaks.com/topic/50014-move-uploaded-file-function-help-required-please/#findComment-245536 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.