upload canvas data to s3

前端 未结 5 1558
刺人心
刺人心 2020-12-25 13:53

Now since the amazon has enabled CORS I was wondering if this is possible.

Can the html canvas data (on client browser) be converted to a <

5条回答
  •  渐次进展
    2020-12-25 14:35

    The easiest way to save canvas is to convert it to base64:

    canvas.toDataURL();
    

    or you can set image type via argument:

    canvas.toDataURL("image/png");
    canvas.toDataURL("image/jpeg");
    // etc
    

    Also watch this lib: http://www.nihilogic.dk/labs/canvas2image/

提交回复
热议问题