你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。
CloudBlockBlob.UploadFromStreamAsync 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
重载
UploadFromStreamAsync(Stream, AccessCondition, BlobRequestOptions, OperationContext, IProgress<StorageProgress>, CancellationToken)
启动异步操作,将流上传到块 Blob。 如果 Blob 已存在,则会覆盖该 Blob。
[Microsoft.Azure.Storage.DoesServiceRequest]
public virtual System.Threading.Tasks.Task UploadFromStreamAsync (System.IO.Stream source, Microsoft.Azure.Storage.AccessCondition accessCondition, Microsoft.Azure.Storage.Blob.BlobRequestOptions options, Microsoft.Azure.Storage.OperationContext operationContext, IProgress<Microsoft.Azure.Storage.Core.Util.StorageProgress> progressHandler, System.Threading.CancellationToken cancellationToken);
[<Microsoft.Azure.Storage.DoesServiceRequest>]
abstract member UploadFromStreamAsync : System.IO.Stream * Microsoft.Azure.Storage.AccessCondition * Microsoft.Azure.Storage.Blob.BlobRequestOptions * Microsoft.Azure.Storage.OperationContext * IProgress<Microsoft.Azure.Storage.Core.Util.StorageProgress> * System.Threading.CancellationToken -> System.Threading.Tasks.Task
override this.UploadFromStreamAsync : System.IO.Stream * Microsoft.Azure.Storage.AccessCondition * Microsoft.Azure.Storage.Blob.BlobRequestOptions * Microsoft.Azure.Storage.OperationContext * IProgress<Microsoft.Azure.Storage.Core.Util.StorageProgress> * System.Threading.CancellationToken -> System.Threading.Tasks.Task
Public Overridable Function UploadFromStreamAsync (source As Stream, accessCondition As AccessCondition, options As BlobRequestOptions, operationContext As OperationContext, progressHandler As IProgress(Of StorageProgress), cancellationToken As CancellationToken) As Task
参数
- accessCondition
- AccessCondition
一个 AccessCondition 对象,表示继续处理请求而必须满足的条件。 如果为 null
,则不使用任何条件。
- options
- BlobRequestOptions
一个 BlobRequestOptions 对象,它指定请求的其他选项。
- operationContext
- OperationContext
一个 OperationContext 对象,它一个表示当前操作的上下文。
- progressHandler
- IProgress<StorageProgress>
用于 IProgress<T> 处理 StorageProgress 消息的 对象。
- cancellationToken
- CancellationToken
等待任务完成期间要观察的 CancellationToken。
返回
表示异步操作的 Task 对象。
- 属性
适用于
UploadFromStreamAsync(Stream)
启动异步操作,将流上传到块 Blob。 如果 Blob 已存在,则会覆盖该 Blob。
[Microsoft.Azure.Storage.DoesServiceRequest]
public virtual System.Threading.Tasks.Task UploadFromStreamAsync (System.IO.Stream source);
[<Microsoft.Azure.Storage.DoesServiceRequest>]
abstract member UploadFromStreamAsync : System.IO.Stream -> System.Threading.Tasks.Task
override this.UploadFromStreamAsync : System.IO.Stream -> System.Threading.Tasks.Task
Public Overridable Function UploadFromStreamAsync (source As Stream) As Task
参数
返回
表示异步操作的 Task 对象。
实现
- 属性
适用于
UploadFromStreamAsync(Stream, Int64)
启动异步操作,将流上传到块 Blob。 如果 Blob 已存在,则会覆盖该 Blob。
[Microsoft.Azure.Storage.DoesServiceRequest]
public virtual System.Threading.Tasks.Task UploadFromStreamAsync (System.IO.Stream source, long length);
[<Microsoft.Azure.Storage.DoesServiceRequest>]
abstract member UploadFromStreamAsync : System.IO.Stream * int64 -> System.Threading.Tasks.Task
override this.UploadFromStreamAsync : System.IO.Stream * int64 -> System.Threading.Tasks.Task
Public Overridable Function UploadFromStreamAsync (source As Stream, length As Long) As Task
参数
- length
- Int64
要从源流中当前位置写入的字节数。
返回
表示异步操作的 Task 对象。
实现
- 属性
适用于
UploadFromStreamAsync(Stream, CancellationToken)
启动异步操作,将流上传到块 Blob。 如果 Blob 已存在,则会覆盖该 Blob。
[Microsoft.Azure.Storage.DoesServiceRequest]
public virtual System.Threading.Tasks.Task UploadFromStreamAsync (System.IO.Stream source, System.Threading.CancellationToken cancellationToken);
[<Microsoft.Azure.Storage.DoesServiceRequest>]
abstract member UploadFromStreamAsync : System.IO.Stream * System.Threading.CancellationToken -> System.Threading.Tasks.Task
override this.UploadFromStreamAsync : System.IO.Stream * System.Threading.CancellationToken -> System.Threading.Tasks.Task
Public Overridable Function UploadFromStreamAsync (source As Stream, cancellationToken As CancellationToken) As Task
参数
- cancellationToken
- CancellationToken
等待任务完成期间要观察的 CancellationToken。
返回
表示异步操作的 Task 对象。
实现
- 属性
适用于
UploadFromStreamAsync(Stream, Int64, CancellationToken)
启动异步操作,将流上传到块 Blob。 如果 Blob 已存在,则会覆盖该 Blob。
[Microsoft.Azure.Storage.DoesServiceRequest]
public virtual System.Threading.Tasks.Task UploadFromStreamAsync (System.IO.Stream source, long length, System.Threading.CancellationToken cancellationToken);
[<Microsoft.Azure.Storage.DoesServiceRequest>]
abstract member UploadFromStreamAsync : System.IO.Stream * int64 * System.Threading.CancellationToken -> System.Threading.Tasks.Task
override this.UploadFromStreamAsync : System.IO.Stream * int64 * System.Threading.CancellationToken -> System.Threading.Tasks.Task
Public Overridable Function UploadFromStreamAsync (source As Stream, length As Long, cancellationToken As CancellationToken) As Task
参数
- length
- Int64
要从源流中当前位置写入的字节数。
- cancellationToken
- CancellationToken
等待任务完成期间要观察的 CancellationToken。
返回
表示异步操作的 Task 对象。
实现
- 属性
适用于
UploadFromStreamAsync(Stream, AccessCondition, BlobRequestOptions, OperationContext)
启动异步操作,将流上传到块 Blob。 如果 Blob 已存在,则会覆盖该 Blob。
[Microsoft.Azure.Storage.DoesServiceRequest]
public virtual System.Threading.Tasks.Task UploadFromStreamAsync (System.IO.Stream source, Microsoft.Azure.Storage.AccessCondition accessCondition, Microsoft.Azure.Storage.Blob.BlobRequestOptions options, Microsoft.Azure.Storage.OperationContext operationContext);
[<Microsoft.Azure.Storage.DoesServiceRequest>]
abstract member UploadFromStreamAsync : System.IO.Stream * Microsoft.Azure.Storage.AccessCondition * Microsoft.Azure.Storage.Blob.BlobRequestOptions * Microsoft.Azure.Storage.OperationContext -> System.Threading.Tasks.Task
override this.UploadFromStreamAsync : System.IO.Stream * Microsoft.Azure.Storage.AccessCondition * Microsoft.Azure.Storage.Blob.BlobRequestOptions * Microsoft.Azure.Storage.OperationContext -> System.Threading.Tasks.Task
Public Overridable Function UploadFromStreamAsync (source As Stream, accessCondition As AccessCondition, options As BlobRequestOptions, operationContext As OperationContext) As Task
参数
- accessCondition
- AccessCondition
一个 AccessCondition 对象,表示继续处理请求而必须满足的条件。 如果为 null
,则不使用任何条件。
- options
- BlobRequestOptions
一个 BlobRequestOptions 对象,它指定请求的其他选项。
- operationContext
- OperationContext
一个 OperationContext 对象,它一个表示当前操作的上下文。
返回
表示异步操作的 Task 对象。
实现
- 属性
适用于
UploadFromStreamAsync(Stream, AccessCondition, BlobRequestOptions, OperationContext, CancellationToken)
启动异步操作,将流上传到块 Blob。 如果 Blob 已存在,则会覆盖该 Blob。
[Microsoft.Azure.Storage.DoesServiceRequest]
public virtual System.Threading.Tasks.Task UploadFromStreamAsync (System.IO.Stream source, Microsoft.Azure.Storage.AccessCondition accessCondition, Microsoft.Azure.Storage.Blob.BlobRequestOptions options, Microsoft.Azure.Storage.OperationContext operationContext, System.Threading.CancellationToken cancellationToken);
[<Microsoft.Azure.Storage.DoesServiceRequest>]
abstract member UploadFromStreamAsync : System.IO.Stream * Microsoft.Azure.Storage.AccessCondition * Microsoft.Azure.Storage.Blob.BlobRequestOptions * Microsoft.Azure.Storage.OperationContext * System.Threading.CancellationToken -> System.Threading.Tasks.Task
override this.UploadFromStreamAsync : System.IO.Stream * Microsoft.Azure.Storage.AccessCondition * Microsoft.Azure.Storage.Blob.BlobRequestOptions * Microsoft.Azure.Storage.OperationContext * System.Threading.CancellationToken -> System.Threading.Tasks.Task
Public Overridable Function UploadFromStreamAsync (source As Stream, accessCondition As AccessCondition, options As BlobRequestOptions, operationContext As OperationContext, cancellationToken As CancellationToken) As Task
参数
- accessCondition
- AccessCondition
一个 AccessCondition 对象,表示继续处理请求而必须满足的条件。 如果为 null
,则不使用任何条件。
- options
- BlobRequestOptions
一个 BlobRequestOptions 对象,它指定请求的其他选项。
- operationContext
- OperationContext
一个 OperationContext 对象,它一个表示当前操作的上下文。
- cancellationToken
- CancellationToken
等待任务完成期间要观察的 CancellationToken。
返回
表示异步操作的 Task 对象。
实现
- 属性
适用于
UploadFromStreamAsync(Stream, Int64, AccessCondition, BlobRequestOptions, OperationContext)
启动异步操作,将流上传到块 Blob。 如果 Blob 已存在,则会覆盖该 Blob。
[Microsoft.Azure.Storage.DoesServiceRequest]
public virtual System.Threading.Tasks.Task UploadFromStreamAsync (System.IO.Stream source, long length, Microsoft.Azure.Storage.AccessCondition accessCondition, Microsoft.Azure.Storage.Blob.BlobRequestOptions options, Microsoft.Azure.Storage.OperationContext operationContext);
[<Microsoft.Azure.Storage.DoesServiceRequest>]
abstract member UploadFromStreamAsync : System.IO.Stream * int64 * Microsoft.Azure.Storage.AccessCondition * Microsoft.Azure.Storage.Blob.BlobRequestOptions * Microsoft.Azure.Storage.OperationContext -> System.Threading.Tasks.Task
override this.UploadFromStreamAsync : System.IO.Stream * int64 * Microsoft.Azure.Storage.AccessCondition * Microsoft.Azure.Storage.Blob.BlobRequestOptions * Microsoft.Azure.Storage.OperationContext -> System.Threading.Tasks.Task
Public Overridable Function UploadFromStreamAsync (source As Stream, length As Long, accessCondition As AccessCondition, options As BlobRequestOptions, operationContext As OperationContext) As Task
参数
- length
- Int64
要从源流中当前位置写入的字节数。
- accessCondition
- AccessCondition
一个 AccessCondition 对象,表示继续处理请求而必须满足的条件。 如果为 null
,则不使用任何条件。
- options
- BlobRequestOptions
一个 BlobRequestOptions 对象,它指定请求的其他选项。
- operationContext
- OperationContext
一个 OperationContext 对象,它一个表示当前操作的上下文。
返回
表示异步操作的 Task 对象。
实现
- 属性
适用于
UploadFromStreamAsync(Stream, Int64, AccessCondition, BlobRequestOptions, OperationContext, CancellationToken)
启动异步操作以将流上传到块 Blob。 如果 Blob 已存在,则会将其覆盖。
[Microsoft.Azure.Storage.DoesServiceRequest]
public virtual System.Threading.Tasks.Task UploadFromStreamAsync (System.IO.Stream source, long length, Microsoft.Azure.Storage.AccessCondition accessCondition, Microsoft.Azure.Storage.Blob.BlobRequestOptions options, Microsoft.Azure.Storage.OperationContext operationContext, System.Threading.CancellationToken cancellationToken);
[<Microsoft.Azure.Storage.DoesServiceRequest>]
abstract member UploadFromStreamAsync : System.IO.Stream * int64 * Microsoft.Azure.Storage.AccessCondition * Microsoft.Azure.Storage.Blob.BlobRequestOptions * Microsoft.Azure.Storage.OperationContext * System.Threading.CancellationToken -> System.Threading.Tasks.Task
override this.UploadFromStreamAsync : System.IO.Stream * int64 * Microsoft.Azure.Storage.AccessCondition * Microsoft.Azure.Storage.Blob.BlobRequestOptions * Microsoft.Azure.Storage.OperationContext * System.Threading.CancellationToken -> System.Threading.Tasks.Task
Public Overridable Function UploadFromStreamAsync (source As Stream, length As Long, accessCondition As AccessCondition, options As BlobRequestOptions, operationContext As OperationContext, cancellationToken As CancellationToken) As Task
参数
- length
- Int64
要从源流中当前位置写入的字节数。
- accessCondition
- AccessCondition
一个 AccessCondition 对象,表示继续处理请求而必须满足的条件。 如果为 null
,则不使用任何条件。
- options
- BlobRequestOptions
一个 BlobRequestOptions 对象,它指定请求的其他选项。
- operationContext
- OperationContext
一个 OperationContext 对象,它一个表示当前操作的上下文。
- cancellationToken
- CancellationToken
等待任务完成期间要观察的 CancellationToken。
返回
表示异步操作的 Task 对象。
实现
- 属性
适用于
UploadFromStreamAsync(Stream, Int64, AccessCondition, BlobRequestOptions, OperationContext, IProgress<StorageProgress>, CancellationToken)
启动异步操作以将流上传到块 Blob。 如果 Blob 已存在,则会将其覆盖。
[Microsoft.Azure.Storage.DoesServiceRequest]
public virtual System.Threading.Tasks.Task UploadFromStreamAsync (System.IO.Stream source, long length, Microsoft.Azure.Storage.AccessCondition accessCondition, Microsoft.Azure.Storage.Blob.BlobRequestOptions options, Microsoft.Azure.Storage.OperationContext operationContext, IProgress<Microsoft.Azure.Storage.Core.Util.StorageProgress> progressHandler, System.Threading.CancellationToken cancellationToken);
[<Microsoft.Azure.Storage.DoesServiceRequest>]
abstract member UploadFromStreamAsync : System.IO.Stream * int64 * Microsoft.Azure.Storage.AccessCondition * Microsoft.Azure.Storage.Blob.BlobRequestOptions * Microsoft.Azure.Storage.OperationContext * IProgress<Microsoft.Azure.Storage.Core.Util.StorageProgress> * System.Threading.CancellationToken -> System.Threading.Tasks.Task
override this.UploadFromStreamAsync : System.IO.Stream * int64 * Microsoft.Azure.Storage.AccessCondition * Microsoft.Azure.Storage.Blob.BlobRequestOptions * Microsoft.Azure.Storage.OperationContext * IProgress<Microsoft.Azure.Storage.Core.Util.StorageProgress> * System.Threading.CancellationToken -> System.Threading.Tasks.Task
Public Overridable Function UploadFromStreamAsync (source As Stream, length As Long, accessCondition As AccessCondition, options As BlobRequestOptions, operationContext As OperationContext, progressHandler As IProgress(Of StorageProgress), cancellationToken As CancellationToken) As Task
参数
- length
- Int64
要从源流中当前位置写入的字节数。
- accessCondition
- AccessCondition
一个 AccessCondition 对象,表示继续处理请求而必须满足的条件。 如果为 null
,则不使用任何条件。
- options
- BlobRequestOptions
一个 BlobRequestOptions 对象,它指定请求的其他选项。
- operationContext
- OperationContext
一个 OperationContext 对象,它一个表示当前操作的上下文。
- progressHandler
- IProgress<StorageProgress>
用于 IProgress<T> 处理 StorageProgress 消息的 对象。
- cancellationToken
- CancellationToken
等待任务完成期间要观察的 CancellationToken。
返回
表示异步操作的 Task 对象。
- 属性