Skip to content
SaltwaterC edited this page Jan 30, 2012 · 1 revision

About

S3 Multipart Upload API helper for uploading a part of a multipart upload that originates from the filesystem

Reference

s3.putFilePart(path, partNumber, uploadId, fileHandler, callback)
  • 'path' - the S3 Path.
  • 'partNumber' - the part number, from 1 to 10,000 inclusive. This is an unique identifier for each upload part.
  • 'uploadId' - the uploadId from s3.initUpload().
  • 'fileHandler' - an object containing the following information: {file: '/path/to/file.ext', options: {start: startByte, end: endByte}}. The start and end byte indicates the byte rage for the underlying fs.ReadStream.
  • '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 an object with the following keys: partNumber and ETag. You need this pair for assembling the uploadParts object for s3.completeUpload().

Each part must be at least 5 MiB (5242880 bytes) in size, except the last part. If you fail to obey this rule, s3.completeUpload() fails with a specific error.

Clone this wiki locally