rajeevs1992

multiple upload

Dec 21st, 2011
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.47 KB | None | 0 0
  1. <html>
  2. <title>Upload</title>
  3. <?php
  4.     session_start();
  5.     $target=$_POST['directory'];
  6.     if($target[strlen($target)-1]!='/')
  7.         $target=$target.'/';
  8.     $count=0;
  9.     foreach ($_FILES['file']['name'] as $filename)
  10.     {
  11.         $temp=$target;
  12.         $tmp=$_FILES['file']['tmp_name'][$count];
  13.         $count=$count + 1;
  14.         $temp=$temp.basename($filename);
  15.         move_uploaded_file($tmp,$temp)
  16.         $temp='';
  17.         $tmp='';
  18.     }
  19. ?>
  20. </html>
Advertisement
Add Comment
Please, Sign In to add comment