document.write('
Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>Title of the document</title>
  6. </head>
  7.  
  8. <body>
  9.  
  10. <form method="post" enctype="multipart/form-data">
  11.     <input name="upload[]" type="file" multiple="multiple" />
  12.     <button type="submit" name="btn-upload">upload</button>
  13. </form>
  14.  
  15. <?php
  16.     //$files = array_filter($_FILES[\'upload\'][\'name\']); something like that to be used before processing files.
  17.     // Count # of uploaded files in array
  18.     $total = count($_FILES[\'upload\'][\'name\']);
  19.  
  20.     // Loop through each file
  21.     for($i=0; $i < $total; $i++)
  22.     {
  23.         //Get the temp file path
  24.         $tmpFilePath = $_FILES[\'upload\'][\'tmp_name\'][$i];
  25.  
  26.         //Make sure we have a filepath
  27.         if ($tmpFilePath != ""){
  28.             //Setup our new file path
  29.             $newFilePath = "./uploadFiles/" . $_FILES[\'upload\'][\'name\'][$i];
  30.  
  31.             //Upload the file into the temp dir
  32.             if(move_uploaded_file($tmpFilePath, $newFilePath)) {
  33.             //Handle other code here
  34.             }
  35.         }
  36.     }
  37. ?>
  38.  
  39. </body>
  40. </html>
');