BackgroundUploader.CreateUpload(Uri, IStorageFile) BackgroundUploader.CreateUpload(Uri, IStorageFile) BackgroundUploader.CreateUpload(Uri, IStorageFile) BackgroundUploader.CreateUpload(Uri, IStorageFile) BackgroundUploader.CreateUpload(Uri, IStorageFile) Method

Definition

Initializes an UploadOperation that indicates the location for and file for upload.

public : UploadOperation CreateUpload(Uri uri, IStorageFile sourceFile)
UploadOperation CreateUpload(Uri uri, IStorageFile sourceFile) const;
public UploadOperation CreateUpload(Uri uri, IStorageFile sourceFile)
Public Function CreateUpload(uri As Uri, sourceFile As IStorageFile) As UploadOperation
var uploadOperation = backgroundUploader.createUpload(uri, sourceFile);
Parameters
uri
Uri Uri Uri

The location for the upload.

sourceFile
IStorageFile IStorageFile 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); });

See Also