Form validation with file upload |
[eluser]tokyotech[/eluser]
I have a form with a text input, a textarea, and file upload. Code: <?=form_open_multipart('club/open')?> The validation rules work well for the two text based inputs, but always extraneously says "the file field is required". Code: $this->form_validation->set_rules( So what's the best way to handle files with the form_validation class? I also wanted to use the upload class to check maximum filesize and whatnot, but it already seems like the form_validation class does not play well with files...
[eluser]überfuzz[/eluser]
Quite right. You better off separating the form_validation and the upload. If the validation is passed continue with the upload.
[eluser]tokyotech[/eluser]
I think I'll just do this: Code: // ....
[eluser]fRkSsK[/eluser]
i didn't work this code. i use this page for how to. but it doesn't give any error. what is the problem? Code: <?php
[eluser]fRkSsK[/eluser]
i found some solutions and i applied that. but still it doesn't work. http://www.mahbubblog.com/php/form-valid...deigniter/
[eluser]tokyotech[/eluser]
The callback should return TRUE if it validates. You have it mixed up. Just use the code I posted earlier!
[eluser]fRkSsK[/eluser]
i changed it. but it still doesn't work. it doesn't care photo_check function. Code: <?php
[eluser]fRkSsK[/eluser]
i got it.. Code: if (!is_uploaded_file($_FILES['h_foto']['tmp_name'])) |
Welcome Guest, Not a member yet? Register Sign In |