CodeIgniter Forums

Full Version: Uploading a file with other information.
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

[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?

El Forum

[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.