CodeIgniter Forums
$this->upload->data() - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: $this->upload->data() (/showthread.php?tid=16229)



$this->upload->data() - El Forum - 02-28-2009

[eluser]mrmeyers99[/eluser]
This isn't really a bug, just an unexpected behavior. A note in the documentation about this would probably suffice.

In my code was doing this:

Code:
$upload_data = $this->upload->data()
if ($upload_data['file_name'] == '')
// do something
I thought that $upload_data['file_name'] would contain the file name even if the upload wasn't successful, like if the file was too big. It took me awhile to figure out that I actually needed to use the $_FILES array to figure out if something was uploaded or not.

Anyway, just a suggestion to put a note about that in the documentation.