Note: This release is in preview. Features described here don’t become generally available until the latest general availability date that Salesforce announces for this release. Before then, and where features are noted as beta, pilot, or developer preview, we can’t guarantee general availability within any particular time frame or at all. Make your purchase decisions only on the basis of generally available products and features.

abortFileUpload(repositoryId, fileId, uploadId)

To cancel a file upload, the abortFileUpload method is invoked. This method is specifically used for aborting multi-part uploads to an external storage.

Signature

1ConnectApi.ContentHubFileUploadConnect.abortFileUpload(repositoryId, fileId, uploadId)

Parameters

  • repositoryId:

    Type: String

    The ID of the repository.

  • fileId:

    Type: String

    The ID of the file to be uploaded.

  • uploadId:

    Type: String

    The ID of the upload task.

  • Sample Code Snippet:
    1     @AuraEnabled(cacheable=false)
    2    public static void abortFileUpload(String repositoryId, String fileId, String uploadId) {
    3        try{
    4            ConnectApi.ContentHubFileUploadConnect.abortFileUpload(repositoryId, fileId, uploadId);
    5            return;
    6        }
    7        catch(Exception ex) {
    8            throw new AuraHandledException('Error in abortFileUpload: ' + ex.getMessage());
    9        }
    10    }