Creating a Directory

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello, I am using the following script to upload files to my server. Is there anyway I can create a directory (on the fly) for the new image to go, as I want people to be able to upload files with the same name.


Thanks

$uploadDir = 'uploads/';
$uploadFile = $uploadDir . $_FILES['form_data']['name'];
print "<pre>";
if (move_uploaded_file($_FILES['form_data']['tmp_name'], $uploadFile))
{
    print "File is valid, and was successfully uploaded. ";
   # print "Here's some more debugging info:\n";
    #print_r($_FILES);
}
else
{
 print "File is invalid. ";
   # print "Possible file upload attack!  Here's some debugging info:\n";
 #   print_r($_FILES);
}
print "</pre>";

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux