co.ador Posted July 22, 2011 Share Posted July 22, 2011 The condition below will execute if the form field has a file. as it is set up right now it throws an error saying that there is not such directory to insert the file which would be $id, the directory images exist but not the $id I was wondering if I need to c reate it first before inserting it? <?php else { $newname = $id.".jpg"; $place_file = move_uploaded_file( $_FILES['fileField']['tmp_name'], "images/$id/".$newname); $success_msg = '<font color="#009900">Your image has been updated, it may take a few minutes for the changes to show... please be patient.</font>'; } be patient.</font>'; ?> This is the error when it try to insert the image if after it validates the field and test is not empty. Warning: move_uploaded_file(images/36/36.jpg) [function.move-uploaded-file]: failed to open stream: No such file or directory in /home3/xample.php on line 74 Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move '/var/tmp/phpuSOXG8' to 'images/36/36.jpg' in /home3/xample.php on line 74 Thanks Quote Link to comment https://forums.phpfreaks.com/topic/242601-what-function-is-used-to-make-a-new-directory-in-php/ Share on other sites More sharing options...
trq Posted July 22, 2011 Share Posted July 22, 2011 mkdir. Quote Link to comment https://forums.phpfreaks.com/topic/242601-what-function-is-used-to-make-a-new-directory-in-php/#findComment-1246012 Share on other sites More sharing options...
co.ador Posted July 22, 2011 Author Share Posted July 22, 2011 Thanks Thorpe. Quote Link to comment https://forums.phpfreaks.com/topic/242601-what-function-is-used-to-make-a-new-directory-in-php/#findComment-1246086 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.