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

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.