Re: Unable to upload multiple files

From: Date: Fri, 31 Jan 2003 15:16:40 +0000
Subject: Re: Unable to upload multiple files
References: 1 2 3 4 5 6 7 8  Groups: php.general 
Request: Send a blank email to php-general+get-133788@lists.php.net to get a copy of this message
Marek Kilimajer wrote:
Show us the code Antti wrote:
1lt John W. Holmes wrote:
Ok now I am able to send the request. I set the post_max_size into 50M and now when the request is sent the whole apache goes down giving: "The document containd no data" everytime I send a request. I tried also 10M but same happens. What the h**l is this?
Do you have this line in your form? <input type="hidden" name="MAX_FILE_SIZE" value="30000"> and is it set to a value greater than the size of all the files you're trying to upload? Some browers actually pay attention to this. ---John Holmes...
No, I don't have that line.
Try it then... ---John Holmes...
No affect. Still gives the "The document contains no data".
The upload form: (There are ofcourse many of of the first three inputs.) <form action='$PHP_SELF' method='POST' enctype='multipart/form-data'> <input class='form' type='text' size='3' name='tracknum[]' value='$tracks'> <input class='form' type='text' size='25' name='uartist[]' value='$uartist'> <input class='form' type='text' size='25' name='usong[]' value=''> <input type='hidden' name='MAX_FILE_SIZE' value='10000'> <input type='hidden' name='upload' value='yes'> <input class='nappi' type='submit' name='submit' value='Upload songs'> And the php part: $number_of_files = count($_FILES['userfile']); for ($i=0; $i < $number_of_files; $i++)
     {
      if ($_FILES['userfile']['size'] !== 0)
            {
       $namename= "$uartist[$i]-$usong[$i].mp3";
       $file=$_FILES['userfile']['tmp_name'][$i];
     if (move_uploaded_file($_FILES['userfile']['tmp_name'][$i], "/mp3/$namename"))
                  {
           print "<tr><td>File $namename upload and rename         succesful!</td></tr>";
                  }
            }
            else
            {
            print "<tr><td>You have to upload some files!</td></tr>";
            }
      }
antti

« previous php.general (#133788) next »