Cloud Storage Integrator 2016 Node.js Edition
Cloud Storage Integrator 2016 Node.js Edition
Questions / Feedback?

CopyBlob Method

Copies a source blob to a destination blob within the same storage account.

Syntax

azureblob.copyBlob(blobName, newContainer, newBlobName, [callback])

Callback

The 'callback' parameter specifies a function which will be called when the operation completes (or an error is encountered). If the 'callback' parameter is not specified, then the method will block and will not return until the operation completes (or an error is encountered).

The callback for this method is defined as:

function(err){ }

'err' is the error that occurred. If there was no error, then 'err' is 'null'.

'err' has 2 properties which hold detailed information:

err.code
err.message

Remarks

This method is used to copy a source blob specified by blobName and contained within ContainerName to a destination blob within a container specified by newContainer with a name of newBlobName.

The following scenarios are supported by the copy blob operation:

  • You can copy a source blob (blobName) to a destination blob (newBlobName) with a different name from that of the source blob. The destination blob can be an existing blob, or a new blob created by the copy operation.
  • You can copy a source blob (blobName) to a destination blob (newBlobName) with the same name, effectively replacing the source blob. Such a copy operation removes any uncommitted blocks and overwrites the blob's metadata.
  • You can copy a snapshot (blobName) over its base blob (newBlobName). By promoting a snapshot to the position of the base blob, you can restore an earlier version of a blob. Note if you wish to copy a snapshot of a blob, you will need to set BlobSnapshot prior to calling CopyBlob
  • You can copy a snapshot (blobName) to a destination blob (newBlobName) with a different name. The resulting destination blob is a writable blob and not a snapshot. Note if you wish to copy a snapshot of a blob, you will need to set BlobSnapshot prior to calling CopyBlob.

If the destination blob (newBlobName) has an active lease, LeaseId must be specified prior to calling CopyBlob.

 
 
Copyright (c) 2019 /n software inc. - All rights reserved.
Cloud Storage Integrator 2016 Node.js Edition - Version 16.0 [Build 7239]