Jump to content

What function is used to make a new directory in php?


co.ador

Recommended Posts

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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.