• Anil Kumar Tilanthe
  • NEWBIE
  • 5 Points
  • Member since 2018

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 2
    Replies
Goal : Need to download multiple content files as a Zip and name the Zip.
Issue : Unable to change the name of the Zip
1. I am able to download multiple content files as a Zip either by using
window.open('/sfc/servlet.shepherd/version/download/' + contentVersionIds.join('/') + '?');
where the Zip folder always has a name "downloaded-content". So I need to change this name to "xyz.zip".

2. Or with JSZip, I am able to create a Zip using JSZip library on client side with the base64 data of different files. However,
When I use JSZip and do saveAs (fileSaver library), I get below error 
Refused to frame '' because it violates the following Content Security Policy directive: "frame-src https: mailto: *.cs80.visual.force.com".
Could someone please tell me if they know how to Download multiple Content files and rename the Zip folder OR how to fix this error?

Regards,
Anil
 
Hi!

Users currently can download single content file in our application. We have href links for users to click to download individual files.

I have added checkbox in front of the content listing, for users to select the contents to bulk download. I am receiveing the list of Content Ids in the apex controller.

how can all the selected files be downloaded via apex?

Thanks!
Jay