Welcome Guest, Not a member yet? Register   Sign In
Form validation with file upload
#3

[eluser]tokyotech[/eluser]
I think I'll just do this:

Code:
// ....
$this->form_validation->set_rules(
    'thumbnail',
    'thumbnail',
    'callback_properThumbnail'
);
// ...

public function properThumbnail($dontCare)
{
    if (!isset($_FILES['thumbnail']) || $_FILES['thumbnail']['size'] <= 0) {
        $this->form_validation->set_message(
            'properThumbnail',
            'The %s is required'
        );
        return false;
    }
    else {
        return true;
    }
}


Messages In This Thread
Form validation with file upload - by El Forum - 12-09-2009, 03:19 AM
Form validation with file upload - by El Forum - 12-09-2009, 04:06 AM
Form validation with file upload - by El Forum - 12-13-2009, 09:11 PM
Form validation with file upload - by El Forum - 02-07-2010, 06:49 PM
Form validation with file upload - by El Forum - 02-07-2010, 07:18 PM
Form validation with file upload - by El Forum - 02-08-2010, 01:21 AM
Form validation with file upload - by El Forum - 02-08-2010, 03:46 PM
Form validation with file upload - by El Forum - 02-08-2010, 04:16 PM



Theme © iAndrew 2016 - Forum software by © MyBB