logoalt Hacker News

edflsafoiewq • yesterday at 10:34 PM • 1 reply • view on HN

I'll try this.

The way I have to resume downloads in Firefox is

1. Move the .part file to a temp file

2. Start the download again; a new .part file gets created

3. Pause the download

4. Move the temp file to the .part file, overwriting it

5. Unpause the download; it resumes from where the old .part file stopped

This is only necessary if a "one-time" download link gets interrupted part-way through, eg. by a flaky connection. Attempting to resume a one-time link like normal gets (I assume) a 400 response and FF kills the .part file.


Replies

cnrcode • yesterday at 10:55 PM

One caveat with that trick: if the server picked a different file or the link now points at a new version, Firefox will happily splice the old .part onto the new bytes and you get a corrupt file with no error. Resume requests only check the range, so unless the server returns an ETag or Last-Modified that matches, nothing guarantees the two halves belong together. Worth checking a hash afterwards if the source publishes one.