It is possible to write a function to handle whatever is in the file input, multiple files or single, and detect the file type.
Have a look at the links I noted above, there’s some pertinent examples on html5rocks, also I think mozilla have some good documentation and examples over here
Hmmmmm, I’m not sure tbh of the implications of only sending binary. Certainly could be done.
I think (from a quick scan), the main purpose of MIME types if for receiving data. So if you’re putting an image on the network, it’s useful for the browser to know what that data is and what to do with it by default.
So maybe:
What do we lose if the metadata is set incorrectly
It’s less that and more ‘what do we gain when it is set correctly’?
But aye, I’m not really versed in this level of networking…
You can set file inputs to allow multiple files to be set. That’s all in your HTML markup on the input. <input type="file" multiple />.
What you do with that file list and how you call safe-js to upload files (which yes, the createOrUpdateFile only handles one file of one type) is up to you…
dataType = 'text/plain' is an ES6 standard called default parameters that allows the developer to specify a default, if the function parameter is undefined.
You just need to specify the type to upload files other than text/plain. See the JS bin link above.