Download file in chunks in Chrome Javascript API?

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

Answers:

Answer

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.

Tags

Recent Questions

Top Questions

Home Tags Terms of Service Privacy Policy DMCA Contact Us

©2020 All rights reserved.