max_file_size

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Each time i try setting MAX_FILE_SIZE in a form and using the upload error code to check if the file is large it always uploads the entire file before showing the error that the file is too big.. either the manual is incorrect or this does not work as every method i've tried always waits for the file to be uploaded before it errors. eg:

<form enctype="multipart/form-data" method="post">
<input type="hidden" name="MAX_FILE_SIZE" value="1048576" />
<input type="file" name="userfile" size="29" />
<input type="submit" name="submit" value="Upload" />
</form>

switch($_FILES['userfile']['error'])
{
  case 1:
   $message[] = 'Error #1 - ...';
  break;

  case 2:
   $message[] = 'Error #2 - File is too big';
  break;

  case 3:
   $message[] = 'Error #3 - File was partially uploaded';
  break;
}

--snip
-- IF no error then start upload...
--snip

yet it waits for file to upload before error.
I've been using php for serveral years and i cant remember ever getting this to work like the manual states.

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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux