Re: uploading 'large' files (e.g. 6MB) -> tmp_name is empty?..

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

 



On Wed, 1 Dec 2004 12:32:07 -0800 (PST), Richard Lynch <ceo@xxxxxxxxx> wrote:
> Note that you also get slightly/subtly different results between:
> 
> Successful file upload.
> File too large (or too many) from php.ini settings.
> User canceled upload.
> User did not fill in upload box before submission.
> 
> I forget the exact differences

Here's a snippet of code I have to handle the errors you get back:

	switch($_FILES['newImage']['error']){
		case 0:
			$submitSuccess = true;
			break;
		case 1:
			$submitError = true;
			$sizeError = 'Image exceeds the php.ini maximum size of ' .
ini_get('upload_max_filesize') . '<br />';
			break;
		case 2:
			$submitError = true;
			$sizeError = 'Image must be ' . IMAGE_MAX_IMAGE_SIZE . ' bytes or
less<br />';
			break;
		case 3:
			$submitError = true;
			$uploadError = 'The uploaded file was only partially uploaded<br />';
		case 4:
			$submitError = true;
			$uploadError = 'No file was uploaded<br />';
	}


-- 
Greg Donald
Zend Certified Engineer
http://gdconsultants.com/
http://destiney.com/

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