CodeIgniter Forums
Uploading a file with other information. - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forum-23.html)
+--- Thread: Uploading a file with other information. (/thread-14885.html)



Uploading a file with other information. - El Forum - 01-19-2009

[eluser]Unknown[/eluser]
I've managed to get the system to upload an image using the example in the user guide under file-uploading_class.

However I also want to pass in a title, and description of the image into the database at the same time.

Can I still use the file uploading class, or should I just process the form submission manually?


Uploading a file with other information. - El Forum - 01-26-2009

[eluser]bapobap[/eluser]
I've used this:

Code:
if ((!$this->upload->do_upload()) OR (!$this->form_validation->run())):

Though this could be wrong. While it works for me, if you fail the validation checks for the form inputs and the page is "refreshed" to show the validation errors, the data file you selected is no longer present in the form.

No big deal for me as it isn't used a lot but it might be annoying if users need to use it a lot.