UploadOperation.StartAsync Method

Definition

Starts an asynchronous upload operation.

public:
 virtual IAsyncOperationWithProgress<UploadOperation ^, UploadOperation ^> ^ StartAsync() = StartAsync;
/// [Windows.Foundation.Metadata.RemoteAsync]
IAsyncOperationWithProgress<UploadOperation, UploadOperation const&> StartAsync();
[Windows.Foundation.Metadata.RemoteAsync]
public IAsyncOperationWithProgress<UploadOperation,UploadOperation> StartAsync();
function startAsync()
Public Function StartAsync () As IAsyncOperationWithProgress(Of UploadOperation, UploadOperation)

Returns

An asynchronous upload operation that includes progress updates.

Attributes

Remarks

Exceptions

COMException

Thrown when a feature-specific HRESULT is returned from a method call.

This is the most common exception that is thrown by networking methods. An app should use the HRESULT from the exception to determine the cause of the error.

AccessDeniedException

Thrown when access is denied to a resource or feature. This exception occurs when an app doesn't have the required network capabilities set in the app manifest for the network operation requested.

InvalidArgumentException

Thrown when one of the arguments that are provided to a method is not valid.

If user-supplied input caused this exception, an app could inform the user and request new input.

ObjectDisposedException

Thrown when an operation is performed on a disposed object.

OutOfMemoryException

Thrown when insufficient memory is available to complete the operation.

An upload operation must be scheduled using one of the BackgroundUploader.CreateUpload, BackgroundUploader.CreateUploadAsync , or BackgroundUploader.CreateUploadFromStreamAsync methods before the StartAsync method is called.

Important

Queuing up a large number of transfers on the main UI thread can result in degraded performance of your app's UI, even though the call is awaitable. If you are queuing up a large number of transfers, it is recommended that you call StartAsync on a background worker thread as in the following example.

operation = await Task.Run(() => { return myUploadOperation.StartAsync(); });

Applies to

See also