PX : code

File Upload !!!!!!! by ChangLing
Rating: 4.00
Download this code


upload.htm  :

<html><head><title>PHP's FileUPLOAD</title></head><body>

<form method="post" action="upload.php" enctype="multipart/form-data"> 
         <input name="userfile[]" type="file">
         <input name="userfile[]" type="file">
         <input name="userfile[]" type="file">
         <input name="userfile[]" type="file">
         <input name="userfile[]" type="file">
         <input name="userfile[]" type="file">
         <input type="submit" value="Upload!!!" >
</form>


upload.php :

<?
   for($i=0;$i<sizeof($userfile);$i++)
   { 
     if(!$userfile_size[$i])
         continue;
 
     $UPLOAD = fopen( $userfile[$i], "r" );
     $contents = fread( $UPLOAD,$userfile_size[$i]);      
     fclose( $UPLOAD );  
     $SAVEFILE = fopen("upload//".$userfile_name[$i], "wb" );
     fwrite( $SAVEFILE, $contents,$userfile_size[$i] );      
     fclose( $SAVEFILE );       
  }    
  echo "Server HaD Receive the Upload Files!";
  
?>

Comments or questions?
PX is running PHP 5.2.17
Thanks to Miranda Productions for hosting and bandwidth.
Use of any code from PX is at your own risk.