Welcome Guest, Not a member yet? Register   Sign In
Upload has issue with some files "You did not select a file to upload"
#4

[eluser]Diggory Laycock[/eluser]
After a bit of reading the PHP docs I noticed this:
http://uk2.php.net/manual/en/features.fi....php#73762
Quote:if POST size exceeds server limit then $_POST and $_FILES arrays become empty. You can track this using $_SERVER['CONTENT_LENGTH'].
For example:

Code:
<?php
$POST_MAX_SIZE = ini_get('post_max_size');
$mul = substr($POST_MAX_SIZE, -1);
$mul = ($mul == 'M' ? 1048576 : ($mul == 'K' ? 1024 : ($mul == 'G' ? 1073741824 : 1)));
if ($_SERVER['CONTENT_LENGTH'] > $mul*(int)$POST_MAX_SIZE && $POST_MAX_SIZE) $error = true;
?>

So it's not CI missing an error - PHP fails silently, unless the upload form has an accurate hidden input before the file input e.g.
Code:
<input type="hidden" name="max_file_size" value="1000" />


Messages In This Thread
Upload has issue with some files "You did not select a file to upload" - by El Forum - 10-24-2008, 07:01 AM



Theme © iAndrew 2016 - Forum software by © MyBB