Skip to content

media file POST using service workers - file API and blobs break mime-multipart reqmt #2

Description

@rowntreerob

Noobie looking over the POST API in a media upload context. Multipart request format obvious where DOM file.input interacts directly to the API. But what about when the client side JS also has service worker and where the API interaction is delegated to the SW? In this case JS -> SW uses file API and Blob Urls for back n forth. The SW loses the multipart form info from the DOM while refs to the Arrays/ buffers holding the media. If i just want to connect the SW's media stream to the appropriate http.request.write.stream in order to POST the file to an api, how to do this if the API signature is always bound to mime-multipart? I'd like a pure, node-STREAM type pipe for a media POST ( binary ArrayBuffer content type post).

comment FWIW - Parse.com filePost API handled this use case.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions