Advertisement
Guest User

upload script

a guest
Dec 14th, 2014
409
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.97 KB | None | 0 0
  1. <html>
  2. <body bgcolor="#4a4a4a">
  3. <div style="text-align:center">
  4. <?php
  5. //Loop through each file
  6. for($i=0; $i<count($_FILES['upload']['name']); $i++) {
  7. //Get the temp file path
  8. $tmpFilePath = $_FILES['upload']['tmp_name'][$i];
  9. $DirName = "" . $_POST['list'];
  10. //Make sure we have a filepath
  11. if ($tmpFilePath != "" && $DirName !="" ){
  12. //Setup our new file path
  13. $newFilePath = "./" . $_POST['list'] . "/" . $_FILES['upload']['name'][$i];
  14. $FileName = "" . $_FILES['upload']['name'][$i];
  15.  
  16. //Upload the file into the temp dir
  17. if(move_uploaded_file($tmpFilePath, $newFilePath)) {
  18.  
  19. //Handle other code here
  20. printf ("Uploaded $FileName to $DirName <br>");
  21. }
  22. } else { printf ("Error <br>");
  23. printf ("Make sure a file and name are selected<br>");
  24. }
  25. }
  26. { printf ('<br><b>Uploads will take up to 15 minutes to show.</b><br>');
  27. printf ('<br><a style="color: #b3b3b3" href="..">Return to Home</a>');
  28. }
  29. ?>
  30. </div>
  31. </body>
  32. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement