Name a PNG file saved from Canvas using an “open with” dialog

后端 未结 3 634
醉酒成梦
醉酒成梦 2020-12-09 12:42

I am working with canvas and I would be able to save my Canvas to png.

By looking around, I discover the great toDataURL() function given by the W3C.

I am al

3条回答
  •  时光取名叫无心
    2020-12-09 13:10

    Unfortunately not. Currently data URIs (used by that canvas2image module; quite neat, actually) do not support specifying filename or content-disposition headers, so the only way to force the browser to generate a save as dialog is to set the content-type to octet-stream.

提交回复
热议问题