![]() |
File upload validation - 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: File upload validation (/showthread.php?tid=16070) |
File upload validation - El Forum - 10-23-2009 [eluser]borgir[/eluser] Hey there! Sorry to bother you guys with the same issue... I'm basing my validation on PistolPete's example and I'm always presented with the message: "O campo Imagem é obrigatório." which means: "The image field is required." Controller: Code: function enviar() { View: Code: <?php echo utf8_encode(form_error('assunto')); ?> Can anyone give me a hint? Thks a lot!! File upload validation - El Forum - 10-23-2009 [eluser]borgir[/eluser] Made some progress here. In the line: Code: $this->form_validation->set_rules('userfile', 'Imagem', 'required|callback__do_upload'); How can I solve this? Thks =) File upload validation - El Forum - 12-23-2010 [eluser]Unknown[/eluser] If I set rule: trim|required|callback__do_upload, Although I upload image valid, but the error always set "The Image field is required." Please help! File upload validation - El Forum - 02-27-2011 [eluser]predat0r[/eluser] Thanks pistolPete, your solution solved my upload validation! :-P [quote author="pistolPete" date="1235453832"]Say we have a form which consists of a input field (called "image_title") and one file upload. Both of them are required to pass the validation. The rule looks like: Code: $this->form_validation->set_rules('image_title', 'Image title', 'trim|required|callback__do_upload'); Code: // callback function to process the file upload and validate it |