Allow to configure a filename for the download attribute

Created on 28 November 2024, 28 days ago

Problem/Motivation

It would be nice if one could also provide a filename to the download attribute. As per HTML spec the download attribute could be used either with or without a filename value. Currently it is only possible to set the download attribute without filename.

Steps to reproduce

Proposed resolution

Provide an additional setting for providing a filename to the download attribute (using tokens too), dependent on the force download attribute.

Remaining tasks

User interface changes

API changes

Data model changes

✨ Feature request
Status

Active

Version

2.0

Component

Code

Created by

πŸ‡©πŸ‡ͺGermany stefan.korn Jossgrund

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @stefan.korn
  • Pipeline finished with Failed
    28 days ago
    Total: 279s
    #353265
  • Pipeline finished with Failed
    28 days ago
    Total: 179s
    #353302
  • πŸ‡©πŸ‡ͺGermany stefan.korn Jossgrund

    Regarding tests I am not too proficient. I would maybe need some input on this. I guess I fixed on of the failing tests, but probably one would have the tests not only fixed, but also targeting the new setting.

    Kindly ask for review.

  • πŸ‡ΊπŸ‡ΈUnited States danflanagan8 St. Louis, US

    Hi, @stefan.korn. The MR looks really good. I really like the use of #states on the settings form. I would be happy to update the tests to cover this new feature.

    Out of curiosity, would you describe the use case where setting force_download_filename was a requirement?

  • πŸ‡©πŸ‡ͺGermany stefan.korn Jossgrund

    Hi @danflanagan8, yes #states is really nice, but I always forget the syntax and need to regoogle it ;-)

    We use file download for a image gallery, where we provide an option for users to download the image in full size. We use an image media for the images and editors can give a name different from the filename to the image media and we want to have the downloaded image named like the image media is named (if this differs from real filename). That works fine on almost any browser as far as I can tell and if it would not work for some browser it would take the real filename, which is also nice because it does not break the functionality.

  • πŸ‡ΊπŸ‡ΈUnited States danflanagan8 St. Louis, US

    Thanks for the clear reply, @stefan.korn. That scenario makes a lot of sense and seems like really good UX for the end user.

    I'll assign this issue to myself to get some tests written.

Production build 0.71.5 2024