Download resources by clicking on images

Hi,

I have the following Javascript code to download a resource by clicking an image (similar to Link in text):

var a = document.createElement(“a”);
a.href = “resources/res_XXXX.pdf”;
a.download = “FileName.pdf”
a.click();

The only issue is when is exported as SCORM and watching it at LMS because of the name while downloading shows the name of the original resource.

My request is to have this same posibility natively on Active Presenter whitout using code and whitout the issue mentioned before. Similar to this:

image

Thanks.

Hi @JuanD18,

If the server (in your case the LMS) resets the filename via the Content-Disposition header, the filename set via the download attribute of the anchor element will not work.
You can file details here: <a>: The Anchor element - HTML: HyperText Markup Language | MDN

Hope this clarifies.

BR,
Quynh Anh