Skip to content

.uploadDataURI #6

@julianlam

Description

@julianlam

The expected input for .upload() seems to be either: { image: { url: 'http://...' } } or { image: { path: '/path/to/file' } }, with name optionally provided as a property in image.

I'd like to send a data URI straight to the plugin, because that's how I get the data (not via form file upload), and it would reduce my steps from:

HTML5 File API -> socket.emit() -> groups.updateCover() -> generate-md5sum -> save-to-disk -> uploader.uploadImage() -> imgur.upload() -> delete-temporary-file

to...

HTML5 File API -> socket.emit() -> groups.updateCover() -> uploader.uploadImage() -> imgur.upload()

Could continue to overload .upload() to handle data URI, up to you.

I imagine in core, we'd change .uploadImage() to handle data URI's being passed in, although we'd introduce a new hook for Data URI uploads in case the plugins can't handle that.

Bonus points if you manage to do this via Node.js Streams 😄

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions