Forum Discussion

DonTino's avatar
DonTino
Community Member
21 days ago
Solved

Code Block and File Download

So i create a lot of custom blocks via the HTML block and it works very good until i want to include a handout in my HTML code. 

 <a href="assets/filename.pdf" class="download-btn" download target="_blank">
                <svg viewBox="0 0 24 24">
                    <path d="M19 9h-4V3H9v6H5l7 7 7-7zM5 18v2h14v-2H5z"/>
                </svg>
                Merkblatt herunterladen (PDF)

The file is in the assets folder and it works when i click it on my desktop. When I use it in the Preview of Rise the button is unresponsive. Is this a known issue or am I doing something wrong?

  • Hi DonTino​ 

    You won't be able to access local files nor create files from within a custom code block in RISE. The code runs in a RISE 'sandboxed' environment - but the browser wouldn't allow you to do it anyway as your request would violate the CORS browser security rules.

    You could try loading the pdf as a 'File Attachment' in RISE then capturing the url of the uploaded pdf file and using that in your code. You are then accessing a file which is already on the RISE server.

3 Replies

  • Hi DonTino,

    Good day! 

    I understand you're encountering issues with the code block you've created in Rise 360.  I've opened a support case on your behalf, so our support engineers can better understand and test this further. 
    We'll continue the conversation over in your case. 

  • Hi DonTino​ 

    You won't be able to access local files nor create files from within a custom code block in RISE. The code runs in a RISE 'sandboxed' environment - but the browser wouldn't allow you to do it anyway as your request would violate the CORS browser security rules.

    You could try loading the pdf as a 'File Attachment' in RISE then capturing the url of the uploaded pdf file and using that in your code. You are then accessing a file which is already on the RISE server.