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
baseball123baseball123 

Generate Zip File from Visualforce Page

I need to create a button on Case. Once the button is clicked, all the files attached with the case need to be put in a zip file and this zip file will be downloaded to user's desktop. Any idea of how to achieve this will be greatly appreciated.

Best Answer chosen by Admin (Salesforce Developers) 
sfdcfoxsfdcfox

You can't do this purely in Visualforce code. The correct method would be to use an embedded application, such as a Java Applet, to compress the files using (for example) java.util.zip, and then present the completed file to the user for saving.

All Answers

sfdcfoxsfdcfox

You can't do this purely in Visualforce code. The correct method would be to use an embedded application, such as a Java Applet, to compress the files using (for example) java.util.zip, and then present the completed file to the user for saving.

This was selected as the best answer
sathishidpsathishidp

Hi,

I am also having same requirement(i.e ., download all the case attachment as zip file with single button click like "Download All Attachment"). So as per your suggestion we can achieve this with the help of java servlet., can you please bring extra description about that and can you give example code also?

sathishidpsathishidp

Hi,

If you found the solution for you post. Can you please share with me?. Because am also having same requirement.

Learing SalesforceLearing Salesforce

Hi..,

 

How to inser a zipfile in visualforce page? I have uploaded my zipfile into static resources but i dont know how to code in VF page to get it.

 

Please answer me.

 

Thanks,