Schedules a new transfer to upload data to Amazon S3. This method is non-blocking and returns immediately (i.e. before the upload has finished).
When uploading options from a stream, callers must supply the size of options in the stream through the content length field in the ObjectMetadata
parameter. If no content length is specified for the input stream, then TransferManager will attempt to buffer all the stream contents in memory and upload the options as a traditional, single part upload. Because the entire stream contents must be buffered in memory, this can be very expensive, and should be avoided whenever possible.
Use the returned Upload
object to query the progress of the transfer, add listeners for progress events, and wait for the upload to complete.
If resources are available, the upload will begin immediately. Otherwise, the upload is scheduled and started as soon as resources become available.
@param bucketName The name of the bucket to upload the new object to.
@param key The key in the specified bucket by which to store the new object.
@param input The input stream containing the options to upload to Amazon S3.
@param objectMetadata Additional information about the object being uploaded, including the size of the options, content type, additional custom user metadata, etc.
@return A new
Upload
object to use to checkthe state of the upload, listen for progress notifications, and otherwise manage the upload.
@throws AmazonClientException If any errors are encountered in the client while making the request or handling the response.
@throws AmazonServiceException If any errors occurred in Amazon S3 while processing the request.