简体   繁体   中英

Does google chrome and similar browsers support range headers for standard downloads

My initial response headers - notice the Accept-Ranges header

HTTP/1.1 200 OK
X-Powered-By: Express
Vary: Origin
Access-Control-Allow-Credentials: true
X-RateLimit-Limit: 1
X-RateLimit-Remaining: 0
Date: Thu, 08 Apr 2021 06:14:19 GMT
X-RateLimit-Reset: 1617862461
Accept-Ranges: bytes
Content-Length: 100000000
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment; filename="some_file.txt"
Connection: keep-alive
Keep-Alive: timeout=5

I then restart the server and click resume download in chrome, but chrome doesn't send back inRange request headers

I'm following the documentation on Mozilla's website

Am I missing a header or misunderstanding how this works, especially with chrome and other browsers? Is there another way I can manually support resuming downloads by sending the right response and understanding the right request? From a technical perspective, if chrome sends back which range it now needs I will be able to resume the download.

According to this article , chrome should support something like this. I just need to be pointed in the right direction.

Ty!

Chrome needs some way to know that the file it's trying to download at that URL is indeed the same file when it tries to resume.

If you add support for an ETag header, this will likely work.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM