My problem is that it doesn't give it the names, it just stays the name that the assetdelivery has (which is just random characters).
I've tried doing it with HttpGet, renaming the link, and rewriting it in another language.
The code gets JSON from an API, parses it, iterates over it, and downloads the files. I run this in snippets because verification things
function downloadURI(uri, name) {
var link = document.createElement("a");
link.download = "tesitnging.rbxl";
link.href = uri;
link.download = "tesitnging.rbxl";
document.body.appendChild(link);
link.download = "tesitnging.rbxl";
link.click();
link.download = "tesitnging.rbxl";
document.body.removeChild(link);
link.download = "tesitnging.rbxl";
console.log()
delete link;
}
Fixed. Used xhrhttprequest then set the to the xhr blob result.
function downloadURI(uri, name) {
var xhr = new XMLHttpRequest();
xhr.open("GET", uri, true);
xhr.responseType = "blob";
xhr.onload = function () {
var url = window.URL.createObjectURL(xhr.response);
var link = document.createElement("a");
link.href = url;
link.setAttribute("download", name + ".rbxl");
document.body.appendChild(link);
link.click();
document.body.removeChild(link);
};
xhr.send();
}