Windows Dev Center

Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

BackgroundUploader.CreateUpload | createUpload method

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

Syntax


var uploadOperation = backgroundUploader.createUpload(uri, sourceFile);

Parameters

uri

Type: Windows.Foundation.Uri [JavaScript] | System.Uri [.NET] | Windows::Foundation::Uri [C++]

The location for the upload.

sourceFile

Type: IStorageFile

The file for upload.

Return value

Type: UploadOperation

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


Requirements (Windows 10 device family)

Device family

Universal

API contract

Windows.Foundation.UniversalApiContract, introduced version 1.0

Namespace

Windows.Networking.BackgroundTransfer
Windows::Networking::BackgroundTransfer [C++]

Metadata

Windows.Foundation.UniversalApiContract.winmd

Requirements (Windows 8.x and Windows Phone 8.x)

Minimum supported client

Windows 8

Minimum supported server

Windows Server 2012

Minimum supported phone

Windows Phone 8.1 [Windows Phone Silverlight 8.1 and Windows Runtime apps]

Namespace

Windows.Networking.BackgroundTransfer
Windows::Networking::BackgroundTransfer [C++]

Metadata

Windows.winmd

See also

UploadOperation
IStorageFile
BackgroundUploader

 

 

Show:
© 2015 Microsoft