summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--system/language/english/upload_lang.php4
-rw-r--r--system/libraries/Upload.php21
-rw-r--r--user_guide/changelog.html1
3 files changed, 23 insertions, 3 deletions
diff --git a/system/language/english/upload_lang.php b/system/language/english/upload_lang.php
index 6837c8acf..ab155acd2 100644
--- a/system/language/english/upload_lang.php
+++ b/system/language/english/upload_lang.php
@@ -2,7 +2,11 @@
$lang['upload_userfile_not_set'] = "Unable to find a post variable called userfile.";
$lang['upload_file_exceeds_limit'] = "The uploaded file exceeds the maximum allowed size in your PHP configuration file";
+$lang['upload_file_exceeds_form_limit'] = "The uploaded file exceeds the maximum size allowed by the submission form.";
$lang['upload_file_partial'] = "The file was only partially uploaded";
+$lang['upload_no_temp_directory'] = "The temporary folder is missing.";
+$lang['upload_unable_to_write_file'] = "The file could not be written to disk.";
+$lang['upload_stopped_by_extension'] = "The file upload was stopped by extension.";
$lang['upload_no_file_selected'] = "You did not select a file to upload";
$lang['upload_invalid_filetype'] = "The filetype you are attempting to upload is not allowed";
$lang['upload_invalid_filesize'] = "The file you are attempting to upload is larger than the permitted size";
diff --git a/system/libraries/Upload.php b/system/libraries/Upload.php
index d045fd24d..387f72526 100644
--- a/system/libraries/Upload.php
+++ b/system/libraries/Upload.php
@@ -154,11 +154,26 @@ class CI_Upload {
switch($error)
{
- case 1 : $this->set_error('upload_file_exceeds_limit');
+ case 1: // UPLOAD_ERR_INI_SIZE
+ $this->set_error('upload_file_exceeds_limit');
break;
- case 3 : $this->set_error('upload_file_partial');
+ case 2: // UPLOAD_ERR_FORM_SIZE
+ $this->set_error('upload_file_exceeds_form_limit');
break;
- case 4 : $this->set_error('upload_no_file_selected');
+ case 3: // UPLOAD_ERR_PARTIAL
+ $this->set_error('upload_file_partial');
+ break;
+ case 4: // UPLOAD_ERR_NO_FILE
+ $this->set_error('upload_no_file_selected');
+ break;
+ case 6: // UPLOAD_ERR_NO_TMP_DIR
+ $this->set_error('upload_no_temp_directory');
+ break;
+ case 7: // UPLOAD_ERR_CANT_WRITE
+ $this->set_error('upload_unable_to_write_file');
+ break;
+ case 8: // UPLOAD_ERR_EXTENSION
+ $this->set_error('upload_stopped_by_extension');
break;
default : $this->set_error('upload_no_file_selected');
break;
diff --git a/user_guide/changelog.html b/user_guide/changelog.html
index 0f6c677d2..a102cc96a 100644
--- a/user_guide/changelog.html
+++ b/user_guide/changelog.html
@@ -95,6 +95,7 @@ Change Log
<li>Moved part of the userguide menu javascript to an external file.</li>
<li>Modified variable names in _ci_load() method of Loader class to avoid conflicts with view variables.</li>
<li>Modified prep_for_form() in the Validation class to accept arrays, adding support for POST array validation (via callbacks only)</li>
+ <li>Modified Upload class $_FILE error messages to be more precise.</li>
<li>Changed the behaviour of custom callbacks so that they no longer trigger the &quot;required&quot; rule. </li>
<li>Changed the behaviour of variables submitted to the where() clause with no values to auto set &quot;IS NULL&quot;</li>
<li>Strengthened the Encryption library to help protect against man in the middle attacks when MCRYPT_MODE_CBC mode is used.</li>