How do i add an create a directory and add a file to it using PHP?

  • Thread starter Thread starter lilshootr07
  • Start date Start date
L

lilshootr07

Guest
Some sample code i used was..
mkdir("/root/path/folder/subfolder");
$root = '/root/path/folder/subfolder/';
$file_name = $root.basename($_FILES['uploadFile'. $x]['name']);
$copy = copy($_FILES['uploadFile'. $x]['tmp_name'],$file_name);

This adds the file to the folder and not the subfolder...
Please help me, im new to PHP
 
Review the "basename" function in Php (www.php.net): you got it wrong!
Also check "is_uploaded_file" and "move_uploaded_file" functions.
 
Back
Top