Open tom-asmblr opened 3 years ago
Yeah, that's doable - we will need to improve https://github.com/httprb/form_data/blob/master/lib/http/form_data/multipart.rb to accept an array pairs instead:
form: [
['metadata', '{}'],
['file', '...'],
# ...
]
Hi, thanks for the great project.
I'm working with an API that requires multiple files to be uploaded such that the file metadata is followed by the file stream, repeating, with each metadata part having the name='metadata' and each file part having the name 'file' For instance, to upload two files:
Having duplicate file names seems odd, but as far as I can see in the spec it's supported, the spec also mentions maintaining the order of the parts.
Obviously using a hash to the pass in the keys doesn't work, as ruby can't have duplicate keys in a hash:
I've found doing the following does add all four parts, however, the order is
metadata, metadata, file, file
, which the API does not accept.Any idea if what I need is possible?
Thanks!