Welcome Guest, Not a member yet? Register   Sign In
Extended validation to validate files
#2

[eluser]tonanbarbarian[/eluser]
The reason the checkme validation is not being run when the input type is file is because there is not a POST variable called myfile.
Instead that data is in the _FILES.
The issue is that the rule says required, and once it determines that the field does not exist in POST then it will stop processing and raise an error indicating that the field is required.
You could try swapping the order of the rules
Code:
$rules['myfile']    = "checkme|required";
but i think the required check is done independantly so it might not work, and then even if the checkme passed it would fail the required and produce a validation error

i think there are some people working on modifications to the validation library to allow it to process the files as well as the post vars.

I would extend the run method of the validation code to copy the _FILES data into the POST array so that the validation rules have something to look at.


Messages In This Thread
Extended validation to validate files - by El Forum - 02-12-2008, 08:48 PM
Extended validation to validate files - by El Forum - 02-12-2008, 09:54 PM



Theme © iAndrew 2016 - Forum software by © MyBB