When I try to download data using a Data URI (this method works in Chrome and Firefox), I use the following code:
url1 = "data:attachment/plain;base64,encodeuri(<base64data-xyz>)"
By specifying the MIME type as attachment, it forces the file to download. If any other MIME type like text/html is used, the content will open in a new tab. Since I wanted to download the file, I used attachment/plain-xyz as the MIME type.
I attempted to use the download attribute, but each time the downloaded file is named "download" without an extension. It ends up being saved in my downloads folder as ".FILE," when I actually need it to be saved as "variable.txt."
Please advise on how to change the downloaded file name from "download.FILE" to something like "variable.txt." I have tried all attributes such as data, download, data-downloadurl, contentdisposition, and even attempting to set pom attributes, with no success.
Your assistance in converting the downloaded file content to a file with a specified filename and .txt extension would be greatly appreciated.