Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dropzone uploadMultiple: true error fix #1062

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

hasanilingi
Copy link

When you set Dropzone.options.uploadForm.uploadMultiple : true in config of an instance of dropzone 5.7.2 the request is created by dropzone creates multidimensional input of the upload like below;
upload[][0]: (binary)
upload[][1]: (binary)
upload[][2]: (binary)

When you send this request it is trying to validate this array values which is already array in UniSharp\LaravelFilemanager::uploadValidator() but it is not a instance of UploadedFile it is instance of array. So with flatting this array we convert request array to a single dimension array like below;
upload[0]: (binary)
upload[1]: (binary)
upload[2]: (binary)

(optional) Issue number:

Summary of the change:

When you set Dropzone.options.uploadForm.uploadMultiple : true in config of an instance of dropzone 5.7.2 the request is created by dropzone creates multidimensional input of the upload like below;
upload[][0]: (binary)
upload[][1]: (binary)
upload[][2]: (binary)

When you send this request it is trying to validate this array values which is already array in UniSharp\LaravelFilemanager::uploadValidator() but it is not a instance of UploadedFile it is instance of array. So with flatting this array we convert request array to a single dimension array like below;
upload[0]: (binary)
upload[1]: (binary)
upload[2]: (binary)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant