I have an app with where I can upload files by posting them to the server given I select an image from my computer.
Now I want to extend that to upload an image that isn’t on my computer, but in the browser as a base64 string. (its a jpeg I’ve exported from a canvas).
Is this at all possible to do just in the browser? Or will I have the convert the base64 on the serverside? Only supporting IE9+
It’s pretty easy to do that, and you don’t even need a type=file input.
Here’s some client-side JS that POSTs the base64’d image (that comes from a canvas): https://github.com/operasoftware/shinydemos/blob/master/demos/photo-booth/scripts/photobooth.js#L152
And then on the server-side (in this case using PHP), just create an image from what you sent:
https://github.com/operasoftware/shinydemos/blob/master/demos/photo-booth/email.php#L6