Skip to content
This repository has been archived by the owner on Nov 16, 2022. It is now read-only.

Inconsistent behavior with large image uploads #267

Open
spacebiscuit opened this issue Jan 10, 2019 · 1 comment
Open

Inconsistent behavior with large image uploads #267

spacebiscuit opened this issue Jan 10, 2019 · 1 comment
Assignees
Labels

Comments

@spacebiscuit
Copy link

spacebiscuit commented Jan 10, 2019

When i try to upload 2 files which are each around 4mb my request data is empty when I debug in my add method of my controller. If I use smaller files I don't experience this behaviour.

Sometimes when I try a 4mb file and a smaller file around 1mb I see the related hasmany images database table is saved with the dir field as null, the foreign key of the parent is saved and no files are uploaded.

To try and address this I added some validation rules, to limit the dimensions of any files uploaded. The following validation method fails:

src\Model\Validation\UserProfferRules.php :: dimensions

line 28:

$fileDimensions = getimagesize($value['tmp_name']);

Since my field is multi-file upload - 'listing_images[]' the data is in an array and so it should be:

$fileDimensions = getimagesize($value[0]['tmp_name']);

I guess I could write my own custom validator to handle this.

@davidyell
Copy link
Owner

davidyell commented Jan 11, 2019

Also worth checking your php.ini file upload settings, and perhaps adding a fileSize validation rule?

@davidyell davidyell added the bug label Jan 11, 2019
@davidyell davidyell self-assigned this Jan 14, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants