Forum Discussion

DonTino's avatar
DonTino
Community Member
22 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=...
  • JohnCooper-be3c's avatar
    9 days ago

    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.