Download data url file

前端 未结 9 1425
猫巷女王i
猫巷女王i 2020-11-22 09:34

I\'m playing with the idea of making a completely JavaScript-based zip/unzip utility that anyone can access from a browser. They can just drag their zip directly into the br

9条回答
  •  有刺的猬
    2020-11-22 09:49

    There are several solutions but they depend on HTML5 and haven't been implemented completely in some browsers yet. Examples below were tested in Chrome and Firefox (partly works).

    1. Canvas example with save to file support. Just set your document.location.href to the data URI.
    2. Anchor download example. It uses to specify file name.

提交回复
热议问题