How to save files locally using html5

走远了吗. 提交于 2019-12-13 05:42:09

问题


how can i download mp3 files locally and then play them using a html5 player , the files should be there even user quit the browser or even come back after couple of days.


回答1:


HTML5 introduced the manifest attribute to the HTML element, which lets you specify a manifest of files to cache locally. All of the examples I saw cache only HTML, CSS, and JS pages, but you could experiment with caching other types of data.

For more information, see:

http://www.webreference.com/authoring/languages/html/HTML5-Application-Caching/ http://www.w3.org/TR/html5/offline.html




回答2:


From what I understand Application Cache is something that is controlled strictly by the manifest file rather than by API. Consequently it renders this feature useless to implement caching of files that you serve on demand such as pdf, mp3, mp4 files.

If anyone can point to some docs that show how to store binary data (essentially this is how you can think of the served resources) on the local device please share the info.



来源:https://stackoverflow.com/questions/6215000/how-to-save-files-locally-using-html5

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!