I'm uploading some files through a form which contains a required field 'Nom de dossier'... it works for 5 files but if i want to upload 6 files the a validation error 'Validation rule required failed for Nom de dossier' arrives... I don't understand what cause this error... can someone help me?
Validation only runs on input fields that are part of the posted form.
Input fields of type "file" are not part of that form, so they can not be validated (that is why the Upload class contains validation for uploaded files). If you defined a validation rule for that field, it will fail because the input is not present.
I know that and I don't want to validate my upload file by the validation class.
I want to validate the title who goes with the files,.
there is only 1 title for all the files
my files are uploaded with no problem (i checked) even with the validate error
I think there is a link because everything (validation and upload) works from 1 to 5 files and it goes wrong after 5 files... there is no logic for me there, that's why I asked for help.
I don't see anything immediately wrong in there.
The model (which I assume contains the validation rules) are missing from this, but I can't think of a reason why a rule would fail based on the number of uploaded files.
Some low-level debugging is needed here, unless someone else has a bright idea...
here is my validation rule
public static function validate($factory)
{
$val = Validation::forge($factory);
$val->add_field('dossier', 'Nom de dossier', 'required');
return $val;
}
this files correspond to the title I was talking about.