I am trying to make a download link, and set the filename that the file is downloaded as.
What I did
I used Element.downloadAs.
What I Expected To Happen
I expected the file to download with the specified filename.
What Actually Happened
It downloaded as "true.csv" (It was a csv file, so that part is expected). Looking at the generated html, it appears that the "download" attribute is not being set properly on the a node. The "download" attribute was set to "true", which seems to be why the file is being called "true.csv".
When I create the link using Html.a and Html.Attributes.downloadAs, the "download" attribute is set to the specified filename.
When I create the link using Html.a and both Html.Attributes.downloadAs and Html.Attributes.download, then I see the same behavior as using Element.downloadAs. I believe that this means that we simply need to remove the Html.Attributes.download part from Element.downloadAs's definition.
The big picture of what I'm trying to do
I am trying to make a download link, and set the filename that the file is downloaded as.
What I did
I used
Element.downloadAs
.What I Expected To Happen
I expected the file to download with the specified filename.
What Actually Happened
It downloaded as "true.csv" (It was a csv file, so that part is expected). Looking at the generated html, it appears that the "download" attribute is not being set properly on the
a
node. The "download" attribute was set to "true", which seems to be why the file is being called "true.csv".When I create the link using
Html.a
andHtml.Attributes.downloadAs
, the "download" attribute is set to the specified filename.When I create the link using
Html.a
and bothHtml.Attributes.downloadAs
andHtml.Attributes.download
, then I see the same behavior as usingElement.downloadAs
. I believe that this means that we simply need to remove theHtml.Attributes.download
part fromElement.downloadAs
's definition.Please see the following Ellie: https://ellie-app.com/5KhDvPXhTa1/2
This Ellie
Versions