user3327457
user3327457

Reputation:

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.

Upvotes: 3

Views: 2800

Answers (1)

Xan
Xan

Reputation: 77523

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.

Upvotes: 2

Related Questions