Skip to content

Commit

Permalink
Use filename as generated by FTL by analyzing the Content-Disposition…
Browse files Browse the repository at this point in the history
… response header

Signed-off-by: DL6ER <[email protected]>
  • Loading branch information
DL6ER committed Oct 12, 2023
1 parent da1fb92 commit 2563213
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions scripts/pi-hole/js/settings-teleporter.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,12 @@ $("#GETTeleporter").on("click", function () {
xhrFields: {
responseType: "blob",
},
success: function (data) {
success: function (data, status, xhr) {
var a = document.createElement("a");
// eslint-disable-next-line compat/compat
var url = window.URL.createObjectURL(data);
a.href = url;
a.download = "teleporter.zip";
a.download = xhr.getResponseHeader("Content-Disposition").split("filename=")[1];
document.body.append(a);
a.click();
a.remove();
Expand Down

0 comments on commit 2563213

Please sign in to comment.