开发者

Javascript Canvas: base64 back to file after resizing&resampling? [duplicate]

开发者 https://www.devze.com 2023-03-18 03:39 出处:网络
This question already has answers here: Closed 10 years ago. Possible Duplicate: Convert Data URI to File then append to FormData
This question already has answers here: Closed 10 years ago.

Possible Duplicate:

Convert Data URI to File then append to FormData

Is i开发者_开发问答t possible to save rendered canvas back to a file in Google Chrome?

I have tried this:

canvas.getAsFile('foo.jpg','image/jpeg')

Doesn't work.

This works only in Firefox:

canvas.mozGetAsFile('foo.jpg')

Of course I can and probably will just send raw base64 encoded string to server and decode it there.

But if it's possible to do it on client-side, i would prefer doing it there.


Maybe this Stack Overflow Question and Answer might help you.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号