Welcome Guest, Not a member yet? Register   Sign In
Validation is not run
#1

[eluser]noonereally[/eluser]
HI,

I encountered strange problem.
I have a form with a lot of fields and some of them are for file uploading(input type="file").
And if try to upload few big files - CI just redisplays the form and shows NO errors.
And validation-> run - retuns FALSE.
I'm trying to upload few images,which individually do not exceed the predefined size in upload.php in config folder.

The question is how do i determine the real problem?
validation_errors() - returns empty array, $this->validation->error_string - returns empty string.

How to debug validation? Or maybe it is upload problem?
#2

[eluser]Thorpe Obazee[/eluser]
The form validation checks for $_POST not for the $_FILES array. You'd have to use a callback to check the $_FILES array.
#3

[eluser]noonereally[/eluser]
[quote author="bargainph" date="1245161036"]The form validation checks for $_POST not for the $_FILES array. You'd have to use a callback to check the $_FILES array.[/quote]

Yes, I know that.
I wonder why validation runs perfectly when I try to upload 2 files, and it doesn't run when there are 3 or more files in a form?
#4

[eluser]pistolPete[/eluser]
Maybe your upload exceeds those PHP settings?
upload_max_filesize
post_max_size

If you have installed Suhosin, there is a setting called suhosin.upload.max_uploads
#5

[eluser]noonereally[/eluser]
[quote author="pistolPete" date="1245174024"]Maybe your upload exceeds those PHP settings?
upload_max_filesize
post_max_size

If you have installed Suhosin, there is a setting called suhosin.upload.max_uploads[/quote]

Yeah, this might be it - post_max_size

There is a problem though... Let's say both limits are 16M and upload.php limit is set to 3M.
But I've got 7 image files to upload. If user selects 7 files and on average they are 2.5M, that makes 17.5M .So my form submit fails. Fails silently... And there's no errors from - $this->upload->display_errors

How do I detect and prevent this kind of situation?

EDIT: So CI Upload class doesn't check for $_SERVER['CONTENT_LENGTH'] ? Which can be smaller than upload size...

P.S. Thanks for all the suggestions, community here is great Smile




Theme © iAndrew 2016 - Forum software by © MyBB