-api-id | -api-type |
---|---|
M:Windows.Networking.BackgroundTransfer.UploadOperation.StartAsync |
winrt method |
Starts an asynchronous upload operation.
An asynchronous upload operation that includes progress updates.
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.
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.
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.
Thrown when an operation is performed on a disposed object.
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(); });
BackgroundTransferError.GetStatus, Handling exceptions in network apps, WebErrorStatus