CodeIgniter Forums
Multi upload file and validation form - 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: Multi upload file and validation form (/showthread.php?tid=41378)



Multi upload file and validation form - El Forum - 05-06-2011

[eluser]loca[/eluser]
I have a form with multi file upload, each file field I have a button to choose a file.
I use form validation but I have problem:
Assume that I have some file fields in view file

Code:
<input name="file1" type="file" />
<input name="file2" type="file" />

In my controller, to validate these file field I use structure of code as in Codeigniter User Guide following

Code:
$this->form_validation->set_rules('username', 'Username', 'callback_username_check');

when I select a file for "file1" and not select any file for "file2". In this time, I don't want to upload any file to my server if all field is required. But if use callback function. Each times I check for validate. "File1" will be uploaded to server.


Multi upload file and validation form - El Forum - 05-06-2011

[eluser]toopay[/eluser]
Validation must be done with inspect $_FILES array, not like text box validation.


Multi upload file and validation form - El Forum - 05-15-2011

[eluser]loca[/eluser]
How can I retain file entry if form validation is not successful?


Multi upload file and validation form - El Forum - 05-16-2011

[eluser]Unknown[/eluser]
can do it everyone but i will try this than i call but now we should do more activity
Automated Forex Trading Software