Re: [PHP] Unable to upload multiple files

2003-02-01 Thread Antti
You don't even have a file form element, or an element named
userfile so your FOR loop will never run...

---John W. Holmes...

PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/




Yes I do. I just forgot to put it here.

input class='nappi' size='20' type='file' name='userfile[]'

-antti



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Unable to upload multiple files

2003-01-31 Thread Justin French
Firstly, try uploading two SMALL files (say, no more than 1k each), just to
check if it's an issue with *two files*, or an issue with *file size*,
*script time outs* (maximum execution time) or something else.

Start ruling them out, one at a time.

Justin


on 01/02/03 12:03 AM, Antti ([EMAIL PROTECTED]) wrote:

 When I push the submit button it starts to send the request to my server
 and uploads a file, but if I upload more than one at a time it doesn't
 even start to upload them. My upload max should be like 50M in php.ini.
 What is the problem.
 
 antti
 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Unable to upload multiple files

2003-01-31 Thread Antti
Justin French wrote:

Firstly, try uploading two SMALL files (say, no more than 1k each), just to
check if it's an issue with *two files*, or an issue with *file size*,
*script time outs* (maximum execution time) or something else.

Start ruling them out, one at a time.

Justin


on 01/02/03 12:03 AM, Antti ([EMAIL PROTECTED]) wrote:



When I push the submit button it starts to send the request to my server
and uploads a file, but if I upload more than one at a time it doesn't
even start to upload them. My upload max should be like 50M in php.ini.
What is the problem.

antti






Two 1 kb files went trough but not two mp3's. What are the critical 
lines in php.ini in this case? Maybe I have missed something...?

antti


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Unable to upload multiple files

2003-01-31 Thread Marek Kilimajer
check max_post_size in php.ini

Antti wrote:


When I push the submit button it starts to send the request to my 
server and uploads a file, but if I upload more than one at a time it 
doesn't even start to upload them. My upload max should be like 50M in 
php.ini. What is the problem.

antti




--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Unable to upload multiple files

2003-01-31 Thread Jason Wong
On Friday 31 January 2003 21:47, Antti wrote:
 Justin French wrote:
  Firstly, try uploading two SMALL files (say, no more than 1k each), just
  to check if it's an issue with *two files*, or an issue with *file size*,
  *script time outs* (maximum execution time) or something else.
 
  Start ruling them out, one at a time.


  on 01/02/03 12:03 AM, Antti ([EMAIL PROTECTED]) wrote:
 When I push the submit button it starts to send the request to my server
 and uploads a file, but if I upload more than one at a time it doesn't
 even start to upload them. My upload max should be like 50M in php.ini.
 What is the problem.
 
 antti

 Two 1 kb files went trough but not two mp3's. What are the critical
 lines in php.ini in this case? Maybe I have missed something...?

As Justin suggested Start ruling them out, one at a time. You've ruled out 
one (number of files). Now figure out whether it's the size. Upload 
successfully larger files until it fails (or otherwise).

-- 
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
To stay youthful, stay useful.
*/


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Unable to upload multiple files

2003-01-31 Thread Antti
Marek Kilimajer wrote:

check max_post_size in php.ini

Antti wrote:


When I push the submit button it starts to send the request to my 
server and uploads a file, but if I upload more than one at a time it 
doesn't even start to upload them. My upload max should be like 50M in 
php.ini. What is the problem.

antti





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?


antti


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Unable to upload multiple files

2003-01-31 Thread 1LT John W. Holmes
 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=3

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...


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Unable to upload multiple files

2003-01-31 Thread Antti
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=3

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.


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Unable to upload multiple files

2003-01-31 Thread 1LT John W. Holmes
 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=3
 
  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...


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Unable to upload multiple files

2003-01-31 Thread Antti
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=3

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.


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Unable to upload multiple files

2003-01-31 Thread Marek Kilimajer
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=3

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.





--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Unable to upload multiple files

2003-01-31 Thread Antti
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=3

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='1'
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 trtdFile $namename upload and rename 
succesful!/td/tr;
  }
}
else
{
print trtdYou have to upload some files!/td/tr;
}
  }

antti



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Unable to upload multiple files

2003-01-31 Thread 1LT John W. Holmes
 input type='hidden' name='MAX_FILE_SIZE' value='1'

You're saying you're only uploading 10K total... for all of the files. If
the browser is respecting this, and you're trying to upload more than 10K,
then it could not upload anything and you get your error.

If it was a PHP issue, it seems like you'd get an error or warning from PHP,
not from the web server (which is where document contains no data would
come from, I assume?)

---John Holmes...


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Unable to upload multiple files

2003-01-31 Thread Marek Kilimajer



 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='' 

I assume here should be input class='form' type='file' size='25' 
name='userfile[]'

input type='hidden' name='MAX_FILE_SIZE' value='1'
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']); 

$number_of_files will be 5 if any number of files is uploaded, cause you 
count $_FILES['userfile']['size'], 
$_FILES['userfile']['name'], $_FILES['userfile']['tmp_name'], $_FILES['userfile']['error'] 
and $_FILES['userfile']['type']
You can count  $_FILES['userfile']['tmp_name'] instead


for ($i=0; $i  $number_of_files; $i++)
 {
  if ($_FILES['userfile']['size'] !== 0) 

use $_FILES['userfile']['size'][$i] here



{
   $namename= $uartist[$i]-$usong[$i].mp3;
   $file=$_FILES['userfile']['tmp_name'][$i];
 if (move_uploaded_file($_FILES['userfile']['tmp_name'][$i], 
/mp3/$namename))
  {
   print trtdFile $namename upload and rename 
succesful!/td/tr;
  }
}
else
{
print trtdYou have to upload some files!/td/tr;
}
  }

antti





--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Unable to upload multiple files

2003-01-31 Thread Jason Wong
On Friday 31 January 2003 22:33, 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=3
  
   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.

  No, I don't have that line.

 Try it then...

Please don't perpetuate this urban legend :-)

_Not_ having that line has no effect on uploads (ie does NOT prevent uploads).

However _having_ that line _may_ prevent uploads.

Thus if you have trouble with uploads then you should NOT have that line. As 
most browsers don't give a monkey about that line there is no reason to have 
it, period.


-- 
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
Ray's Rule of Precision:
Measure with a micrometer.  Mark with chalk.  Cut with an axe.
*/


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Unable to upload multiple files

2003-01-31 Thread Antti
1lt John W. Holmes wrote:

input type='hidden' name='MAX_FILE_SIZE' value='1'



You're saying you're only uploading 10K total... for all of the files. If
the browser is respecting this, and you're trying to upload more than 10K,
then it could not upload anything and you get your error.

If it was a PHP issue, it seems like you'd get an error or warning from PHP,
not from the web server (which is where document contains no data would
come from, I assume?)

---John Holmes...



That 10 k is not the right value that I had. I had 10 but just 
edited it and it changed when I pasted it here. So that is not the proglem.

After all these changes it still doesn't work =(...

antti


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Unable to upload multiple files

2003-01-31 Thread John W. Holmes
 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='1'
 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 trtdFile $namename upload and rename
  succesful!/td/tr;
}
  }
  else
  {
  print trtdYou have to upload some files!/td/tr;
  }
}

You don't even have a file form element, or an element named
userfile so your FOR loop will never run...

---John W. Holmes...

PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php