Amazon Simple Storage Service
开发人员指南 (API Version 2006-03-01)
AWS 服务或AWS文档中描述的功能,可能因地区/位置而异。点 击 Getting Started with Amazon AWS to see specific differences applicable to the China (Beijing) Region.

跟踪分段上传进度

低级别分段上传 API 将提供事件 UploadPartRequest.StreamTransferProgress 来跟踪上传进度。

事件将定期发生并且将返回分段上传进度信息,例如,传输的总字节数以及事件发生时传输的字节数。

以下 C# 代码示例演示了如何订阅 StreamTransferProgress 事件和编写处理程序。

Copy
UploadPartRequest uploadRequest = new UploadPartRequest { // provide request data. }; uploadRequest.StreamTransferProgress += new EventHandler<StreamTransferProgressArgs>(UploadPartProgressEventCallback); ... public static void UploadPartProgressEventCallback(object sender, StreamTransferProgressArgs e) { // Process event. Console.WriteLine("{0}/{1}", e.TransferredBytes, e.TotalBytes); }