function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
khushbu parmar 5khushbu parmar 5 

When using /sfc/servlet.shepherd/document/download/ <ContentDocument IDs> , can we rename the zip folder document?

Hello

    I have used the Custom button (/sfc/servlet.shepherd/document/download/ ) to download all the files realed to an object. The Zip folder always has a name “downloaded-content”. So I need to change this name to “file.zip”.

    Is it possible to rename the Zip folder?
    It is pretty urgent.

    Thanks
VinayVinay (Salesforce Developers) 
Hi Khushbu,

This might not be possible to rename zip.

You can give try using JSZip and FileSaver (JS libraries) or URL parameters like ?name=foo.zip, ?filename=foo.zip, ?zip=foo.zip but this might not work as well.

Hope above information was helpful.

Please mark as Best Answer so that it can help others in the future.

Thanks,
Vinay Kumar
khushbu parmar 5khushbu parmar 5
Hi Vinay,

I have tried to use the URL and added the filename you suggested, but it is not working anymore.
I have used the Apex class and Lightning component to achieve the zip file feature. So will it help me rename using JSZip library?

Thanks,
Khushbu
VinayVinay (Salesforce Developers) 
Hi Khushbu,

You can give a try but I don't think it will work.

Also servlet.shepherd is undocumented so we do not have much information but as said earlier renaming zip might not be possible.

Hope above information was helpful.

Thanks,
Vinay Kumar
sharath chandra parsisharath chandra parsi
Hi Khushbu,

Were you able to fix this problem? I am also facing the same issue, Looking for the fix. Any Inputs will be greatly helpful