download-manager retry saves status code 204/4XX/5XX response body to local download folder
Categories
(Firefox :: File Handling, enhancement)
Tracking
()
People
(Reporter: wangf1978, Unassigned)
Details
Attachments
(2 files)
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:107.0) Gecko/20100101 Firefox/107.0
Steps to reproduce:
- Preparing a big zip file, for example, photos.zip, 20MB
- Put it to http server side, and write a simple download web page
<pre>
<!DOCTYPE html>
<html>
<body>
<a href="photos.zip">Download a zip file</a>
<body>
</html>
</pre> - Download it with FF, and then cancel it before the download is finished
- Remove this file from http server
- In FF download manager, select the canceled download file, and retry the download
Actual results:
It will download the below response body, and save the below 404 page as "photos.zip"
<pre>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<title>Error response</title>
</head>
<body>
<h1>Error response</h1>
<p>Error code: 404</p>
<p>Message: File not found.</p>
<p>Error code explanation: HTTPStatus.NOT_FOUND - Nothing matches the given URI.</p>
</body>
</html>
</pre>
It is very confused, and let end-user misunderstand that the original file is already downloaded successfully. I also try to modify server response content-type to "application/octet-stream", content-length to "0" or "-1", all does not work even save a photos.zip with zero size.
Expected results:
If the retried download URL response status code is 204/4xx/5xx, not download any file into the local download folder. In the download manager of other browsers, for example, Chrome, it does not save anything to local download folder if the status code is 204/4xx/5xx.
| Reporter | ||
Comment 1•3 years ago
|
||
When server responses 204, Chrome and Edge will show "Failed - No file"
| Reporter | ||
Comment 2•3 years ago
|
||
In FF, the server side responses 204, and the content-type is "application/octet-stream", and content-length is 0, it saved the file with zero-length in the local download folder successfully.
| Reporter | ||
Comment 3•3 years ago
|
||
- There exists the similar discussion #312727 from webpage download some years ago, the behavior is expected, but download manager does not keep the same behavior.
- There is also the discussion "Why isn't it possible to download a file for status code 4XX and 5XX" in stack-overflow about the download from webpage
Here it is expected that FF download manager can keep the same behavior.
| Reporter | ||
Updated•3 years ago
|
| Reporter | ||
Updated•3 years ago
|
Comment 4•3 years ago
|
||
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:108.0) Gecko/20100101 Firefox/108.0
Hi,
Thank you for opening this enhancement. I will set this accordingly, as New.
Thanks for your input.
Description
•