You need to sign in to do that
Don't have an account?
SS Karthick
Create Zipfile in salesforce
Hi folks,
Can anyone tell me how to create a zip file in salesforce via apex?
I have seen the below link but it doesnt work for me.
http://www.valnavjo.com/blog/compressing-files-in-salesforce/
Please someone give me the working code sinppet for creating zipfile.
Thanks in advance
Karthick
Can anyone tell me how to create a zip file in salesforce via apex?
I have seen the below link but it doesnt work for me.
http://www.valnavjo.com/blog/compressing-files-in-salesforce/
Please someone give me the working code sinppet for creating zipfile.
Thanks in advance
Karthick
//Get body as a blob
Blob ResponseString=res.getBodyAsBlob();
System.debug('Response str is '+ResponseString);
//save file in Attachment
attachment DataFile = new attachment();
//store file as a zip file
DataFile.Name = 'xyzzipfile.zip';
DataFile.ParentId ='a049000000HRSkc';
DataFile.body = ResponseString;
DataFile.contentType='application/x-zip-compressed';
insert DataFile;
Similer to above method you can create zip file in apex
My usecase is download all the attachements on click of visualforce button.
For that we need to create a zip file which contains all the attachments.
I need a sample code for my usecase.
Thanks in advance,
Karthick