Advertisement
Guest User

Untitled

a guest
Mar 8th, 2012
319
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.99 KB | None | 0 0
  1. <html>
  2.  
  3. <head>
  4.   <title>bele</title>
  5. </head>
  6.  
  7. <body>
  8. <?php
  9.  
  10.  
  11.  if(empty($_GET['Nfiles']))$Nfiles=30;else $Nfiles=$_GET['Nfiles'];
  12. if($_FILES['userfile']['tmp_name'][0]!=''){
  13.     for($i=0;$i<$Nfiles&&$_FILES['userfile']['tmp_name'][$i]!='';$i++){
  14.     $uploaddir = dirname(__FILE__);//'/var/www/uploads/';
  15.     $uploadfile = $uploaddir .'/'. basename($_FILES['userfile']['name'][$i]);
  16.     print "<pre>";
  17.     if (move_uploaded_file($_FILES['userfile']['tmp_name'][$i], $uploadfile)) {
  18.        print "File is valid, and was successfully uploaded. ";
  19.        //print_r($_FILES);
  20.     } else {
  21.        print "Possible fie upload attack!  Here's some debugging info:\n";
  22.        //print_r($_FILES);
  23.     }
  24.     print "</pre>";
  25.     }
  26. }
  27. ?>
  28. <form action="<?php echo $_SERVER['PHP_SELF'].'?Nfiles='.$Nfiles; ?>" method="post" enctype="multipart/form-data">
  29.   Send beleberda:<br>
  30.   <?php for($i=0;$i<$Nfiles;$i++){echo '<input name="userfile[]" type="file"><br>';}?>
  31.   <input type="submit" value="Send files">
  32. </form>
  33.  
  34. </body>
  35.  
  36. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement