You need to sign in to do that
Don't have an account?
Eriko Yamamura
How can I make zip file?
Hello,
I would like to create a custom action to download record attachments as a zip in LightningExperience.
I created a controller and Visualforce to download attachments obtained using zippex https://github.com/pdalcol/Zippex.
But even small files will give errors.
Error: System.LimitException: Apex CPU time limit exceeded
I researched myself and found that using @future can avoid it, but I don't know what code to write.
I do not have enough knowledge as a developer.
Please Help me.
I would like to create a custom action to download record attachments as a zip in LightningExperience.
I created a controller and Visualforce to download attachments obtained using zippex https://github.com/pdalcol/Zippex.
public class ImageZipController { public final ParentObject__c parent {get; set;} private Id parentObjId; public ImageZipController(ApexPages.StandardController stdController) { this.order = (order__c)stdController.getRecord(); } public PageReference downloadAttachments(){ orderId = order.Id; String objectId = parentObjId; String docName = 'test.zip'; List<Attachment> attachments = [SELECT Name, Body FROM Attachment WHERE ParentId = :objectId]; System.debug('>>> attachments ' + attachments.size()); Zippex sampleZip = new Zippex(); for(Attachment file : attachments) { sampleZip.addFile('folder/' + file.Name, file.Body, null); } try{ Document doc = new Document(); doc.FolderId = UserInfo.getUserId(); doc.Name = docName; doc.Body = sampleZip.getZipArchive(); insert doc; System.debug('>>> doc ' + doc.Id); return new PageReference('/servlet/servlet.FileDownload?file=' + doc.Id); } catch ( Exception ex ) { System.debug('>>> ERROR ' + ex); } return null; } }
But even small files will give errors.
Error: System.LimitException: Apex CPU time limit exceeded
I researched myself and found that using @future can avoid it, but I don't know what code to write.
I do not have enough knowledge as a developer.
Please Help me.
Also see: livethetech.com
https://www.livethetech.com/tamilrockers-unblocked-tamilrockers-proxy-sites/
https://www.livethetech.com/khatrimaza-cool-2019-download-movies-free/
Visit my blog - starsbiodata.com (https://starsbiodata.com/)
TamilMV 2020 – Download Tamil, Telugu, Malayalam, Kannada Hindi Dubbed Movies For Free (https://starsbiodata.com/tamilmv/)
Bolly4u 2020 – Download Tamil, Telugu, Malayalam, Kannada Hindi Dubbed Movies For Free (https://starsbiodata.com/bolly4u/)
http://www.49westwineandspirits.com/ (http://www.49westwineandspirits.com)
I have done my work check it now (https://mob.faceliy.com/)