diff options
author | Florian Pritz <bluewind@xinu.at> | 2011-06-12 21:04:13 +0200 |
---|---|---|
committer | Florian Pritz <bluewind@xinu.at> | 2011-06-12 21:11:44 +0200 |
commit | fc0e2000733536fedd2da6ca2b219382c2f98518 (patch) | |
tree | cbf9ba81a3a254f7d2429564b0c9d1e25617daba /application/controllers/file.php | |
parent | bc8cd4f81d57763d7b3cf73138c4befee3f1139c (diff) |
upload_error: print more precise error message
Signed-off-by: Florian Pritz <bluewind@xinu.at>
Diffstat (limited to 'application/controllers/file.php')
-rw-r--r-- | application/controllers/file.php | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/application/controllers/file.php b/application/controllers/file.php index 0f5b53d5e..b1804b42f 100644 --- a/application/controllers/file.php +++ b/application/controllers/file.php @@ -131,8 +131,17 @@ class File extends CI_Controller { $extension = $this->input->post('extension'); if(!isset($_FILES['file']) || $_FILES['file']['error'] !== 0) { $this->output->set_status_header(400); + $errors = array( + 0=>"There is no error, the file uploaded with success", + 1=>"The uploaded file exceeds the upload_max_filesize directive in php.ini", + 2=>"The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form", + 3=>"The uploaded file was only partially uploaded", + 4=>"No file was uploaded", + 6=>"Missing a temporary folder" + ); + $data["msg"] = $errors[$_FILES['file']['error']]; $this->load->view($this->var->view_dir.'/header', $data); - $this->load->view($this->var->view_dir.'/upload_error'); + $this->load->view($this->var->view_dir.'/upload_error', $data); $this->load->view($this->var->view_dir.'/footer'); return; } |