BackgroundUploader.CreateUpload(Uri, IStorageFile) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Initializes an UploadOperation that indicates the location for and file for upload.
public:
virtual UploadOperation ^ CreateUpload(Uri ^ uri, IStorageFile ^ sourceFile) = CreateUpload;
UploadOperation CreateUpload(Uri const& uri, IStorageFile const& sourceFile);
public UploadOperation CreateUpload(System.Uri uri, IStorageFile sourceFile);
function createUpload(uri, sourceFile)
Public Function CreateUpload (uri As Uri, sourceFile As IStorageFile) As UploadOperation
Parameters
- sourceFile
- IStorageFile
The file for upload.
Returns
The resultant upload operation.
Remarks
Important
Creating a large number of transfers on the main UI thread with CreateUpload can result in degraded performance of your app's UI. If you are queuing up a large number of transfers, it is recommended that you call CreateUpload on a background worker thread as in the following example.
operation = await Task.Run(() => { return myDownloader.CreateUpload(uri, file); });