BlobTransferClient.UploadBlob Method (Uri, String, FileEncryption, CancellationToken, CloudBlobClient, IRetryPolicy, String, String)
Uploads a file to a blob storage.
Namespace: Microsoft.WindowsAzure.MediaServices.Client
Assembly: Microsoft.WindowsAzure.MediaServices.Client (in Microsoft.WindowsAzure.MediaServices.Client.dll)
Syntax
'Declaration
Public Function UploadBlob ( _
url As Uri, _
localFile As String, _
fileEncryption As FileEncryption, _
cancellationToken As CancellationToken, _
client As CloudBlobClient, _
retryPolicy As IRetryPolicy, _
contentType As String, _
subDirectory As String _
) As Task
'Usage
Dim instance As BlobTransferClient
Dim url As Uri
Dim localFile As String
Dim fileEncryption As FileEncryption
Dim cancellationToken As CancellationToken
Dim client As CloudBlobClient
Dim retryPolicy As IRetryPolicy
Dim contentType As String
Dim subDirectory As String
Dim returnValue As Task
returnValue = instance.UploadBlob(url, _
localFile, fileEncryption, cancellationToken, _
client, retryPolicy, contentType, _
subDirectory)
public Task UploadBlob(
Uri url,
string localFile,
FileEncryption fileEncryption,
CancellationToken cancellationToken,
CloudBlobClient client,
IRetryPolicy retryPolicy,
string contentType,
string subDirectory
)
public:
Task^ UploadBlob(
Uri^ url,
String^ localFile,
FileEncryption^ fileEncryption,
CancellationToken cancellationToken,
CloudBlobClient^ client,
IRetryPolicy^ retryPolicy,
String^ contentType,
String^ subDirectory
)
member UploadBlob :
url:Uri *
localFile:string *
fileEncryption:FileEncryption *
cancellationToken:CancellationToken *
client:CloudBlobClient *
retryPolicy:IRetryPolicy *
contentType:string *
subDirectory:string -> Task
public function UploadBlob(
url : Uri,
localFile : String,
fileEncryption : FileEncryption,
cancellationToken : CancellationToken,
client : CloudBlobClient,
retryPolicy : IRetryPolicy,
contentType : String,
subDirectory : String
) : Task
Parameters
- url
Type: System.Uri
The URL where file needs to be uploaded. If blob has private write permissions then appropriate SAS URL need to be passed.
- localFile
Type: System.String
The full path of local file.
- fileEncryption
Type: Microsoft.WindowsAzure.MediaServices.Client.FileEncryption
The file encryption if file needs to be stored encrypted. Pass null if no encryption required.
- cancellationToken
Type: System.Threading.CancellationToken
The cancellation token.
- client
Type: CloudBlobClient
The client which will be used to upload file. Use client if request need to be signed with client credentials. When upload performed using SAS URL, then client can be null.
- retryPolicy
Type: IRetryPolicy
The RetryPolicy delegate returns a ShouldRetry delegate, which can be used to implement a custom retry policy. RetryPolicies class can be used to get default policies.
- contentType
Type: System.String
The content type of the blob.
- subDirectory
Type: System.String
Virtual subdirectory for this file in the blog container.
Return Value
Type: System.Threading.Tasks.Task
Returns Task.