In our app we currently have a native shim to allow file blobs to be passed to Http.multipartBody.
It basically looks like this:
const filePart = (name, blob) => ({
_0: name,
_1: blob
});
window._xtian$someApp$Native_Utils_FileReader = {
filePart: F2(filePart)
};
In Elm code we listen for the change event of an <input type="file"> and decode the event payload into a Json.Decode.Value which we pass to this helper:
filePart : String -> Json.Decode.Value -> Http.Part
filePart name blob =
Native.Utils.FileReader.filePart name blob
If we wanted to migrate away from this solution to be compatible with 0.19, what would be the best approach?