You need to sign in to do that
Don't have an account?
Adeesh maddukuri
How to convert data of Versiondata field to create zip file using JSZip
Hi,
I'm trying to create a page to download multiple files as a zipfile using JSZip. I used rest api to retrive data of versiondata filed. but I'm facing problem to use that to create zip file. Please find the code below.
Thanks in Advance.
I'm trying to create a page to download multiple files as a zipfile using JSZip. I used rest api to retrive data of versiondata filed. but I'm facing problem to use that to create zip file. Please find the code below.
Thanks in Advance.
function download(){ var zip = new JSZip(); console.log('download function'); var checkedSize = j$("input[name='doc_ids_group[]']:checked").size(); console.log('checkedSize = '+checkedSize); j$("input[name='doc_ids_group[]']:checked").each(function() { console.log("inside each loop = "+j$(this).val()); var id=j$(this).val(); j$.ajax({url: "/services/data/v32.0/sobjects/ContentVersion/"+id+"/VersionData", headers : { 'Authorization' : "OAuth " + sessionId, 'Content-Type': ' application/octet-stream', }, async: false, success: function(result){ zip.file(id, result, { base64: true }); }}); }); saveAs(zip.generate({type:"blob"}), 'Download.zip', false); }
kumar M 21