ShareFileClient.CreateAsync Method

Definition

Creates a new file or replaces an existing file.

For more information, see Create File.

public virtual System.Threading.Tasks.Task<Azure.Response<Azure.Storage.Files.Shares.Models.ShareFileInfo>> CreateAsync (long maxSize, Azure.Storage.Files.Shares.Models.ShareFileCreateOptions options = default, Azure.Storage.Files.Shares.Models.ShareFileRequestConditions conditions = default, System.Threading.CancellationToken cancellationToken = default);
abstract member CreateAsync : int64 * Azure.Storage.Files.Shares.Models.ShareFileCreateOptions * Azure.Storage.Files.Shares.Models.ShareFileRequestConditions * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response<Azure.Storage.Files.Shares.Models.ShareFileInfo>>
override this.CreateAsync : int64 * Azure.Storage.Files.Shares.Models.ShareFileCreateOptions * Azure.Storage.Files.Shares.Models.ShareFileRequestConditions * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response<Azure.Storage.Files.Shares.Models.ShareFileInfo>>
Public Overridable Function CreateAsync (maxSize As Long, Optional options As ShareFileCreateOptions = Nothing, Optional conditions As ShareFileRequestConditions = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Task(Of Response(Of ShareFileInfo))

Parameters

maxSize
Int64

Required. Specifies the maximum size for the file in bytes. The max supported file size is 4 TiB.

options
ShareFileCreateOptions

Optional parameters.

conditions
ShareFileRequestConditions

Optional ShareFileRequestConditions to add conditions on creating the file.

cancellationToken
CancellationToken

Optional CancellationToken to propagate notifications that the operation should be cancelled.

Returns

A Response<T> describing the state of the file.

Remarks

This method only initializes the file. To add content, use Azure.Storage.Files.Shares.ShareFileClient.UploadRangeAsync(Azure.HttpRange,System.IO.Stream,System.Byte[],System.IProgress{System.Int64},Azure.Storage.Files.Shares.Models.ShareFileRequestConditions,System.Threading.CancellationToken).

Applies to