AWS SDK Version 2 for .NET
API Reference

AWS services or capabilities described in AWS Documentation may vary by region/location. Click Getting Started with Amazon AWS to see specific differences applicable to the China (Beijing) Region.

.NET Framework 3.5
 

Provides a high level utility for managing transfers to and from Amazon S3.

TransferUtility provides a simple API for uploading content to and downloading content from Amazon S3. It makes extensive use of Amazon S3 multipart uploads to achieve enhanced throughput, performance, and reliability.

When uploading large files by specifying file paths instead of a stream, TransferUtility uses multiple threads to upload multiple parts of a single upload at once. When dealing with large content sizes and high bandwidth, this can increase throughput significantly.

Inheritance Hierarchy

System.Object
  Amazon.S3.Transfer.TransferUtility

Namespace: Amazon.S3.Transfer
Assembly: AWSSDK.dll
Version: (assembly version)

Syntax

C#
public class TransferUtility : Object
         IDisposable

The TransferUtility type exposes the following members

Constructors

Properties

NameTypeDescription
Public Property S3Client Amazon.S3.IAmazonS3 Gets the Amazon S3 client used for making calls into Amazon S3.

Methods

NameDescription
Public Method AbortMultipartUploads(string, DateTime) Aborts the multipart uploads that were initiated before the specified date.
Public Method BeginAbortMultipartUploads(string, DateTime, AsyncCallback, object) Initiates the asynchronous execution of the AbortMultipartUploads operation. Amazon.S3.Transfer.TransferUtility.AbortMultipartUploads
Public Method BeginDownload(string, string, string, AsyncCallback, object) Initiates the asynchronous execution of the Download operation. Amazon.S3.Transfer.TransferUtility.Download
Public Method BeginDownload(TransferUtilityDownloadRequest, AsyncCallback, object) Initiates the asynchronous execution of the Download operation. Amazon.S3.Transfer.TransferUtility.Download
Public Method BeginDownloadDirectory(string, string, string, AsyncCallback, object) Initiates the asynchronous execution of the DownloadDirectory operation. Amazon.S3.Transfer.TransferUtility.DownloadDirectory
Public Method BeginDownloadDirectory(TransferUtilityDownloadDirectoryRequest, AsyncCallback, object) Initiates the asynchronous execution of the DownloadDirectory operation. Amazon.S3.Transfer.TransferUtility.DownloadDirectory
Public Method BeginOpenStream(string, string, AsyncCallback, object) Initiates the asynchronous execution of the OpenStream operation. Amazon.S3.Transfer.TransferUtility.Upload
Public Method BeginOpenStream(TransferUtilityOpenStreamRequest, AsyncCallback, object) Initiates the asynchronous execution of the OpenStream operation. Amazon.S3.Transfer.TransferUtility.Upload
Public Method BeginUpload(string, string, AsyncCallback, object) Initiates the asynchronous execution of the Upload operation. Amazon.S3.Transfer.TransferUtility.Upload
Public Method BeginUpload(string, string, string, AsyncCallback, object) Initiates the asynchronous execution of the Upload operation. Amazon.S3.Transfer.TransferUtility.Upload
Public Method BeginUpload(Stream, string, string, AsyncCallback, object) Initiates the asynchronous execution of the Upload operation. Amazon.S3.Transfer.TransferUtility.Upload
Public Method BeginUpload(TransferUtilityUploadRequest, AsyncCallback, object) Initiates the asynchronous execution of the Upload operation. Amazon.S3.Transfer.TransferUtility.Upload
Public Method BeginUploadDirectory(string, string, AsyncCallback, object) Initiates the asynchronous execution of the UploadDirectory operation. Amazon.S3.Transfer.TransferUtility.UploadDirectory
Public Method BeginUploadDirectory(string, string, string, SearchOption, AsyncCallback, object) Initiates the asynchronous execution of the UploadDirectory operation. Amazon.S3.Transfer.TransferUtility.UploadDirectory
Public Method BeginUploadDirectory(TransferUtilityUploadDirectoryRequest, AsyncCallback, object) Initiates the asynchronous execution of the UploadDirectory operation. Amazon.S3.Transfer.TransferUtility.UploadDirectory
Public Method Dispose() Disposes of all managed and unmanaged resources.
Public Method Download(string, string, string) Downloads the content from Amazon S3 and writes it to the specified file.
Public Method Download(TransferUtilityDownloadRequest) Downloads the content from Amazon S3 and writes it to the specified file. If the key is not specified in the request parameter, the file name will used as the key name.
Public Method DownloadDirectory(string, string, string) Downloads the objects in Amazon S3 that have a key that starts with the value specified by s3Directory.
Public Method DownloadDirectory(TransferUtilityDownloadDirectoryRequest) Downloads the objects in Amazon S3 that have a key that starts with the value specified by the S3Directory property of the passed in TransferUtilityDownloadDirectoryRequest object.
Public Method EndAbortMultipartUploads(IAsyncResult) Finishes the asynchronous execution of the AbortMultipartUploads operation. Amazon.S3.Transfer.TransferUtility.AbortMultipartUploads
Public Method EndDownload(IAsyncResult) Finishes the asynchronous execution of the Download operation. Amazon.S3.Transfer.TransferUtility.Download
Public Method EndDownloadDirectory(IAsyncResult) Finishes the asynchronous execution of the DownloadDirectory operation. Amazon.S3.Transfer.TransferUtility.Download
Public Method EndOpenStream(IAsyncResult) Finishes the asynchronous execution of the OpenStream operation. Amazon.S3.Transfer.TransferUtility.UploadDirectory
Public Method EndUpload(IAsyncResult) Finishes the asynchronous execution of the Upload operation. Amazon.S3.Transfer.TransferUtility.UploadDirectory
Public Method EndUploadDirectory(IAsyncResult) Finishes the asynchronous execution of the UploadDirectory operation. Amazon.S3.Transfer.TransferUtility.UploadDirectory
Public Method OpenStream(string, string) Returns a stream from which the caller can read the content from the specified Amazon S3 bucket and key. The caller of this method is responsible for closing the stream.
Public Method OpenStream(TransferUtilityOpenStreamRequest) Returns a stream to read the contents from Amazon S3 as specified by the TransferUtilityOpenStreamRequest. The caller of this method is responsible for closing the stream.
Public Method Upload(string, string) Uploads the specified file. The object key is derived from the file's name. Multiple threads are used to read the file and perform multiple uploads in parallel. For large uploads, the file will be divided and uploaded in parts using Amazon S3's multipart API. The parts will be reassembled as one object in Amazon S3.
Public Method Upload(string, string, string) Uploads the specified file. Multiple threads are used to read the file and perform multiple uploads in parallel. For large uploads, the file will be divided and uploaded in parts using Amazon S3's multipart API. The parts will be reassembled as one object in Amazon S3.
Public Method Upload(Stream, string, string) Uploads the contents of the specified stream. For large uploads, the file will be divided and uploaded in parts using Amazon S3's multipart API. The parts will be reassembled as one object in Amazon S3.
Public Method Upload(TransferUtilityUploadRequest) Uploads the file or stream specified by the request. To track the progress of the upload, add an event listener to the request's UploadProgressEvent. For large uploads, the file will be divided and uploaded in parts using Amazon S3's multipart API. The parts will be reassembled as one object in Amazon S3.
Public Method UploadDirectory(string, string) Uploads files from a specified directory. The object key is derived from the file names inside the directory. For large uploads, the file will be divided and uploaded in parts using Amazon S3's multipart API. The parts will be reassembled as one object in Amazon S3.
Public Method UploadDirectory(string, string, string, SearchOption) Uploads files from a specified directory. The object key is derived from the file names inside the directory. For large uploads, the file will be divided and uploaded in parts using Amazon S3's multipart API. The parts will be reassembled as one object in Amazon S3.
Public Method UploadDirectory(TransferUtilityUploadDirectoryRequest) Uploads files from a specified directory. The object key is derived from the file names inside the directory. For large uploads, the file will be divided and uploaded in parts using Amazon S3's multipart API. The parts will be reassembled as one object in Amazon S3.

Remarks

Transfers are stored in memory. If the application is restarted, previous transfers are no longer accessible. In this situation, if necessary, you should clean up any multipart uploads that are incomplete.

Version Information

.NET Framework:
Supported in: 4.5, 4.0, 3.5

.NET for Windows Store apps:
Supported in: Windows 8.1, Windows 8

.NET for Windows Phone:
Supported in: Windows Phone 8.1, Windows Phone 8