Public NotInheritable Class UploadOperation Inherits Object Implements IBackgroundTransferOperation
The UploadOperation class has these types of members:
The UploadOperation class has these methods. With C#, Visual Basic, and C++, it also inherits methods from the Object class.
|AttachAsync||Returns an asynchronous operation that can be used to monitor progress and completion of the attached upload. Calling this method allows an app to attach upload operations that were started in a previous app instance.|
|GetResponseInformation||Gets the response information.|
|GetResultStreamAt||Gets the partially uploaded response at the specified location.|
|StartAsync||Starts an asynchronous upload operation.|
The UploadOperation class has these properties.
|Read/write||Gets and sets the cost policy for the upload.|
|Read-only||Gets a string value indicating the group the upload belongs to.|
|Read-only||This is a unique identifier for a specific upload operation. A GUID associated to a upload operation will not change for the duration of the upload.|
|Read-only||Gets the method to use for the upload.|
|Read-only||Gets the current progress of the upload operation.|
|Read-only||Gets the URI to upload from.|
|Read-only||Specifies the IStorageFile to upload.|
After app termination, an app should enumerate all existing UploadOperation instances at next start-up using GetCurrentUploadsAsync. When a Windows Store app using Background Transfer is terminated, incomplete uploads will persist in the background. If the app is restarted after termination and these incomplete operations are not enumerated and re-introduced to the current session, they will go stale and continue to occupy device resources.
1.) When establishing a new connection for an upload over TCP/SSL, the connection attempt is aborted if not established within five minutes.
2.) After the connection has been established, an HTTP request message that has not received a response within two minutes is aborted.
Assuming there is Internet connectivity, Background Transfer will retry an upload up to three times. In the event Internet connectivity is not detected, additional attempts will not be made until it is.
Stopping a debugging session in Microsoft Visual Studio is comparable to closing your app; PUT uploads are paused and POST uploads are aborted. Even while debugging, your app should enumerate and then pause, restart, or cancel any persisted uploads.
However, if Visual Studio project updates, like changes to the app manifest, require that the app is uninstalled and re-deployed for debugging, GetCurrentUploadsAsync cannot enumerate persisted operations created using the previous app deployment.
The following example demonstrates how to configure and begin a basic upload operation, and is based on the Background Transfer sample offered in the Windows Sample Gallery.
Minimum supported client
|Windows 8 [Windows Store apps only]|
Minimum supported server
|Windows Server 2012 [Windows Store apps only]|
Build date: 12/4/2012