completeUpload()
This method is used to complete attachments upload once the files have been uploaded to Amazon S3.
List<ResultObject>Â completeUpload(List<ID>Â wipIds)
Parameters:
wipIds:Â List of Salesforce ids for attachment "file" records. These IDs have been returned from the initializeUpload() method for each file record.
Return Value:Â The method will return the list of Result Object (Figure 127), which holds filecompletion status information.
Â
Notes:
If you want to confirm that file(s) are successfully uploaded to Amazon, you can use the getAmazonHeader() method to get headers which is returned by Amazon S3 for a given file. You can also compare the ETag header, the MD5 checksum calculated by Amazon when the file is uploaded to S3, with the MD5 that you calculate for the file(s).
If you set the success{_}action_status to 201 status code during the upload process, you can also use XML document which is returned by Amazon S3 to compare ETag header with MD5 check sum.
Example code:
List<Id>wipIds = new List<Id>();
wipIds.add(ID.valueOf(uploadRequestInfos .fileWipId));
List<cg.ResultObject>resultObjects = cg.SDriveTools.completeUpload(wipIds);