diff options
author | Florian Pritz <bluewind@xinu.at> | 2012-04-08 23:54:50 +0200 |
---|---|---|
committer | Florian Pritz <bluewind@xinu.at> | 2012-04-09 20:48:00 +0200 |
commit | 516072b12b38a789fe7847ef8dad5e48c271019d (patch) | |
tree | 2e21c90c031261b5fbbefed3c97988f8811f281a /application | |
parent | 69d92ecc7c7e5aeda44f9fb2a22906e25c6e5279 (diff) |
do_upload(): fix errors if no file was uploaded
Signed-off-by: Florian Pritz <bluewind@xinu.at>
Diffstat (limited to 'application')
-rw-r--r-- | application/controllers/file.php | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/application/controllers/file.php b/application/controllers/file.php index 2e8664984..c2838b795 100644 --- a/application/controllers/file.php +++ b/application/controllers/file.php @@ -232,7 +232,12 @@ class File extends CI_Controller { 4=>"No file was uploaded", 6=>"Missing a temporary folder" ); - $this->data["msg"] = $errors[$_FILES['file']['error']]; + + $this->data["msg"] = "Unknown error."; + + if (isset($_FILES["file"])) { + $this->data["msg"] = $errors[$_FILES['file']['error']]; + } $this->load->view($this->var->view_dir.'/header', $this->data); $this->load->view($this->var->view_dir.'/upload_error', $this->data); $this->load->view($this->var->view_dir.'/footer'); |