Download file in chunks in Chrome Javascript API?

我们两清 提交于 2019-12-20 03:16:55

问题


Does the Chrome Javascript API support downloading a file in several chunks simultaneously? eg in a download manager.


回答1:


Short answer: no, no special support. There is a dedicated chrome.downloads API, but it's just the same mechanism as normal Chrome downloads, i.e. single stream.

Long answer: You can make it yourself via XMLHttpRequest by setting range attributes, e.g.

xhr.setRequestHeader("Range", "bytes=100-200");

See more information here, and potential problems you can run into in this question.



来源:https://stackoverflow.com/questions/23309841/download-file-in-chunks-in-chrome-javascript-api

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