Forum Discussion

MarieRaidl's avatar
MarieRaidl
Community Member
12 months ago

Javascript to download a file

Hello!

I would like to set a trigger on a button that will download a PDF to the users "Downloads" folder. I don't want the trigger to open the print window but to directly trigger the download of the pdf file. The pdf file could be reached either via URL or embedded as an object in the storyline file.

I have searched e-Learning Heroes but didn't find any Javascript that triggers an automatic download. 

Appreciate if anyone can help!

Marie

  • I understand your concern and I'm trying to help solve your Problem please implement the provided instructions I hope are helpful for you.

    In your e-Learning tool (e.g., Storyline), add a button element to your slide.

    Select the button, and in the trigger settings, choose to "Jump to URL/File."

    Enter the direct URL of the PDF file you want users to download.

    Test the button in your course to ensure it works as intended.

    Now, when users click the button, it will trigger the download of the PDF file directly to their "Downloads" folder, without opening the print window.

    Thank you!

  • MarieRaidl's avatar
    MarieRaidl
    Community Member

    Hi Samuel,

    thanks so much for your thoughts on this. In Storyline 360 there is no "Jump to URL/file" in the trigger wizard. See print screen attached. There is "open URL/file", but that won't download the file. It will simply open it.