Closed Bug 1845642 Opened 2 years ago Closed 7 days ago

<a> tag 'download' attribute value is not used when downloading files

Categories

(Firefox for Android :: Downloads, defect)

Firefox 115
All
Android
defect

Tracking

()

RESOLVED FIXED
Tracking Status
firefox154 --- verified

People

(Reporter: theoriginaljamesfranco, Unassigned)

References

Details

(Whiteboard: [fxdroid][group4])

Attachments

(2 files)

Steps to reproduce:

Click a link that has the "download" attribute set to some value. For example:

<a href="/img/my-image.png" download="my-filename.png">Download</a>

The link should be for a same-origin resource, and should be served from a server that doesn't specify a filename in the Content-Disposition HTTP header (this would take precedence over the value of the attribute).

Actual results:

I'm prompted to download the file, but the proposed filename is that of the linked resource ("my-image.png" in the above example).

Expected results:

The proposed filename should be the value of the download attribute ("my-filename.png").

In Chrome Desktop / Firefox Desktop / Chrome Android , the file is downloaded as "my-filename.png".

In Fenix the file is downloaded as "my-image.png".

Reference:
[1] https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#attributes
[2] WHATWG-suggested algorithm to select a filename for a resource being handled as a download

Status: UNCONFIRMED → NEW
Ever confirmed: true

The severity field is not set for this bug.
:mavduevskiy, could you have a look please?

For more information, please visit BugBot documentation.

Flags: needinfo?(mavduevskiy)
Severity: -- → S4
Priority: -- → P5
Flags: needinfo?(mavduevskiy)
See Also: → 1867717

Based on this comment this seems like a broken web-platform feature and should be re-prioritized.

Severity: S4 → --
Priority: P5 → --
Duplicate of this bug: 1941652
Severity: -- → S3
Whiteboard: [fxdroid][group4]

As my bug was duped to this one, I'm not sure if the issue is located into GeckoView or not, but I wanted to point that not only Fenix is affected, but Firefox Focus as well.

Thanks for the additional note, this bug will be to fix it in both Fenix and Focus, using android-components.

See Also: → 676619
Attached file repro-download-a.zip

Hey,
I managed to make a repro here: https://download-atest.staticdomains.app/

You can also download the archive I've attached, run python3 -m http.server 8080 and load it on Fenix.

STR

Actual result

  • The picture is downloaded as myw3schoolsimage.jpg

Expected result

  • The picture should be downloaded as newname.jpg
Depends on: 2051418

I think this was solved by bug 2051418 entirely. (During the initial investigation, it looked like it might take two steps.)

Flags: qe-verify+
Attached image 1845642.jpg

Verified as fixed on the latest Firefox for Android Nightly 154.0a1 from 7/12 using a Pixel 6 (Android 17).

Status: NEW → RESOLVED
Closed: 7 days ago
Flags: qe-verify+
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: