alejandrard Posted February 10, 2009 Share Posted February 10, 2009 I been working for hours on this I don't understand what is going on, I am trying to upload a file I'm using local host and I have XAMPP, I have my form: <form action="" method="post" id="add_book" enctype="multipart/form-data"> <tr> <td valign="top"><strong>Graphic Upload:</strong></td> <td valign="top"><input type="file" name="graphic_upload" size="30" /><br /><br /></td> </tr> <tr> <td valign="top" align="right"><input type="submit" name="submit" value="submit" /><br /><br /></td> </tr> </table> </form> I have my upload code: $uploaddir = ROOTDIRECTORY.'book_images/'; if ( is_uploaded_file($_FILES[graphic_upload] [tmp_name])) { //this is not working in my local host if(move_uploaded_file($_FILES[graphic_upload][tmp_name], $uploaddir.$_FILES[graphic_upload][name])) {echo "File Upload";} else {echo "File Not Upload";} } To debug I have print the $_FILES variable and everything seems to be there. When it goes through the code is_uploaded_file() function returns true but the move_uploaded_file() returns the following error Warning: move_uploaded_file(/publishing/book_images/stop_bothering.jpg) [function.move-uploaded-file]: failed to open stream: No such file or directory in C:\xampp\htdocs\publishing\admin_addbook.php on line 82 Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move 'C:\xampp\tmp\php23F.tmp' to '/publishing/book_images/stop_bothering.jpg' in C:\xampp\htdocs\publishing\admin_addbook.php on line 82 I have check the directory path for hours ???, can some one help me? Quote Link to comment Share on other sites More sharing options...
gizmola Posted February 10, 2009 Share Posted February 10, 2009 Have you checked the permissions on the directories involved? Often this is caused by the web server not having the permissions it needs on one or more of the directories. Quote Link to comment Share on other sites More sharing options...
PFMaBiSmAd Posted February 10, 2009 Share Posted February 10, 2009 Do you have a folder - C:/publishing/book_images/ or is it something like - C:\xampp\htdocs\publishing/book_images/ Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.