Skip to content
SaltwaterC edited this page Nov 16, 2011 · 5 revisions

About

S3 helper for renaming / changing the path of an existing S3 object.

Reference

s3.renameObject(sourcePath, targetPath, cannedAcl, callback)
  • 'sourcePath' - the source S3 Path.
  • 'targetPath' - the target S3 Path.
  • 'cannedAcl' - the S3 Canned ACL.
  • 'callback' - the callback that is executed when the processing finishes. It has a couple of arguments: error and result.
  • If there's an error, the callback receives the error argument as Error instance.
  • If the error argument is null, then the response argument contains the response.headers object as returned by the node.js core HTTPS client.

This helper does not re-upload the object. It uses the PUT Object - Copy method via the x-amz-copy-source HTTP header. It preserves the Content-Type and Cache-Control headers of the original object.

Clone this wiki locally