Why do browsers append a .part extension to partial downloads?

2

Many modern browsers, when told to download some online resource into a file, will not directly write data to the target file, but instead create an empty file with the destination filename, and write downloaded data a separate file with the appended extension .part, .download or similar. When the download is complete, the partially-downloaded file is renamed to the intended name, without the extra extension.

I remember older browsers not doing this. Utilities like wget or curl don't do it either. I can think of some rationale myself, but is there a definitive reason why this behaviour was introduced? Why the .part extension, and why the empty file?

user3840170

Posted 2019-06-09T10:25:18.483

Reputation: 151

Answers

2

It's so you don't try to open the file until the download is completed.

LawrenceC

Posted 2019-06-09T10:25:18.483

Reputation: 63 487

I think this is it. Some programs (Transmission for example) give you the option to append .part or not to incomplete downloads.

– lx07 – 2019-06-09T16:02:52.060

Why the additional empty file then? – user3840170 – 2019-09-03T08:50:46.183

-2

Why the .part extension?

The .part file is a marker that there is download in progress. Its size indicates how much has been downloaded so far and allows the browser to pause and resume the download (provided the server allows this).

It also allows the browser to resume an interrupted download later (for example if a download is paused and the browser closed it is not possible to directly resume the download).

In this case, you can resume the download as follows:

The usual procedure where you want to resume an interrupted download is as follows:

Make sure to backup the .part file and the final file with size 0 without the .part before starting Firefox.

Try these steps to resume an unfinished download when you still have the .part file.

  1. Move the old .part partial download and the final file without the .part that has size 0 to another location.
  2. Start a new download and pause it, don't close Firefox.
  3. Copy the two files (.part and 0 byte final) that you moved above back to the download location to replace the new files that were created.
  4. Resume the download in Firefox.

Source How to resume interrupted download? (.part file is available)

DavidPostill

Posted 2019-06-09T10:25:18.483

Reputation: 118 938

1wget -c can resume without this .part-related hassle, so I don't think this is the reason. – Kamil Maciorowski – 2019-06-09T10:46:15.660

@KamilMaciorowski So can browsers - when there is a paused download in the download manager. If you close the browser then you cannot resume a paused download later. Hence the workaround in the answer. The .part file is a marker that there is download in progress. Answer expanded. Please reread. – DavidPostill – 2019-06-09T10:50:04.333

Start a new download and pause it – I think I need to specify the link and the exact name again, don't I? I need this with wget -c as well, but in this case there is no .part file, I don't have to move/copy the files back and forth. wget just appends to the destination file. For now I read your answer as ".part extension is to make simple things complicated". It's a disadvantage and I assume there is at least one advantage to outweigh it. The advantage (or advantages) will be the real answer. – Kamil Maciorowski – 2019-06-09T11:02:47.067