• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Extended validation to validate files

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
$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

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.