You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I wonder why, when we upload multiple files, the request is like
files[]:[{....},{...}]
and not simply files:[{....},{...}]
When I upload only one file everything works well but with multiple files I have troubles for selecting them in my back-end with multer or multiparty due to that special key. I can't select a key that contain special characters like [].
I tried to edit paramNamespace or paramName but that doesn't fix the problem.
With multer I have this error: {"code":"LIMIT_UNEXPECTED_FILE","field":"files[]","storageErrors":[]}
When I reopen Uploader object and edit createFormData method to remove the [] in the key everything works well.
Am I the only one that encounter this problem?
The text was updated successfully, but these errors were encountered:
I think this a Rails convention for passing arrays so the framework knows the data should be an array. But I'm not a Rails guy, so the origin may be something else. But I've seen this syntax used with Rails.
This is a convention that was used in PHP and indeed with Rails as well as other languages/frameworks. It isn't a standard as far as I know. Depending on what you are using on the server, you will either use the key without brackets or with. I'm up for suggestions on this. Do I construct the names programmatically or continue with the current implementation?
Ok thank you for the reply.
I think this will be nice if the format of the key can be defined by the developer that will use your plugin in depending on his backend.
I wonder why, when we upload multiple files, the request is like
files[]:[{....},{...}]
and not simply
files:[{....},{...}]
When I upload only one file everything works well but with multiple files I have troubles for selecting them in my back-end with multer or multiparty due to that special key. I can't select a key that contain special characters like [].
I tried to edit paramNamespace or paramName but that doesn't fix the problem.
With multer I have this error:
{"code":"LIMIT_UNEXPECTED_FILE","field":"files[]","storageErrors":[]}
When I reopen Uploader object and edit createFormData method to remove the [] in the key everything works well.
Am I the only one that encounter this problem?
The text was updated successfully, but these errors were encountered: