anwaykabir

Download file failing if the zip file size is too big.

0 votes

Hello, We have integrated our salesforce application with onespan using APEX SDK.

We have an use case where we ask Signers to upload some additional documents (eg Driver's license, void cheques etc). We used the OneSpanAPIObjects.AttachmentRequirement method to update the package with additional upload doc requests.And once the package is Complete, we download those attachment asynchronously using downloadAllAttachmentFilesForSignerInPackage method. This method downloads all attachments uploaded by a particular signer. The problem is sometimes individual file sizes are big, and when the combined attachment size is crossing around 9 MB, salesforce is not allowing to download them (due to download size limit on asynch callouts). Do you have any method exposed to download those files one by one for a signer instead of downloading all together? Or, do we need to query the package and download the attachments one by one?


Reply to: Download file failing if the zip file size is too big.

0 votes

Hi Anway,

From JSON's perspective, there's no attribute indicates the size of the attachment. (However, 9MB for a single document should be enough for most cases) 

In APEX SDK, there's no method exposed to download attachments one by one per signer. Therefore you may have to query the package and download the attachments using code like below:

 

ESignLiveSDK sdk = new ESignLiveSDK();
//retrieve attachments' status
ESignLiveAPIObjects.Role retrievedRole1 = sdk.getRole(packageId,roleId);
for(ESignLiveAPIObjects.AttachmentRequirement attachment: retrievedRole1.attachmentRequirements){
     System.debug('Attachment: ' + attachment.id+ ' : ' + attachment.name + ' : ' + attachment.status);  

    //Download individual attachment
    Blob downloadAttachmentFile = downloadAttachmentFile(packageId,attachment.id);
}

 

You can find the

"public Blob downloadAttachmentFile(String packageId, String attachmentId)"

function I created from this code share, with detailed information documented at Attachment Requirements Guide.

 

Duo

 

 

Duo Liang OneSpan Evangelism and Partner Integrations Developer


Hello! Looks like you're enjoying the discussion, but haven't signed up for an account.

When you create an account, we remember exactly what you've read, so you always come right back where you left off