Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Firefox - set Blob download source

I am creating a script that lets you download a CSV File of current table on the page like this:

var downloadLink = document.createElement("a");
var blob = new Blob(["", CSVString], {type: 'text/csv;charset=utf-8'});

if (navigator.appVersion.toString().indexOf('.NET') > 0) {
    window.navigator.msSaveOrOpenBlob(blob, "Daten.csv");
} 
else {
    downloadLink.href = window.URL.createObjectURL(blob);
    downloadLink.download = "Daten.csv";
    downloadLink.style.display = 'none';
    document.body.appendChild(downloadLink);

    downloadLink.click();
}

Now if I use IE it asks if I want to download a file from localhost, but in Mozilla Firefox the download window says "From: blob:". Can it be changed to show the host name or a name that I specify (e.g. Test)?

like image 875
marcinstl Avatar asked Aug 21 '17 08:08

marcinstl


People also ask

How do I change download settings in Firefox?

Chosen Solution. Click the Firefox button, go to Options | Options | General and in the Downloads menu, checkmark the option "Always ask me where to save files". Click the Firefox button, go to Options | Options | General and in the Downloads menu, checkmark the option "'''Always ask me where to save files'''".


1 Answers

Pitifully there's no available solution till the date. The issue was reported a couple of years ago but it seems it has the minor importance level and no one is asigned to this issue.

The From label will always display from: blob::

enter image description here

No matter what you do.

like image 154
Carlos Delgado Avatar answered Oct 13 '22 08:10

Carlos Delgado