Form validation with file upload - 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: Form validation with file upload (/showthread.php?tid=25339) |
Form validation with file upload - El Forum - 12-09-2009 [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... Form validation with file upload - El Forum - 12-09-2009 [eluser]überfuzz[/eluser] Quite right. You better off separating the form_validation and the upload. If the validation is passed continue with the upload. Form validation with file upload - El Forum - 12-13-2009 [eluser]tokyotech[/eluser] I think I'll just do this: Code: // .... Form validation with file upload - El Forum - 02-07-2010 [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 Form validation with file upload - El Forum - 02-07-2010 [eluser]fRkSsK[/eluser] i found some solutions and i applied that. but still it doesn't work. http://www.mahbubblog.com/php/form-validation-callbacks-in-hmvc-in-codeigniter/ Form validation with file upload - El Forum - 02-08-2010 [eluser]tokyotech[/eluser] The callback should return TRUE if it validates. You have it mixed up. Just use the code I posted earlier! Form validation with file upload - El Forum - 02-08-2010 [eluser]fRkSsK[/eluser] i changed it. but it still doesn't work. it doesn't care photo_check function. Code: <?php Form validation with file upload - El Forum - 02-08-2010 [eluser]fRkSsK[/eluser] i got it.. Code: if (!is_uploaded_file($_FILES['h_foto']['tmp_name'])) |