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.

BackgroundDownloader.CreateDownloadAsync | createDownloadAsync method

Applies to Windows and Windows Phone

Creates an asynchronous download operation that includes a URI, the file that the response will be written to, and the IInputStream object from which the file contents are read.

Syntax


backgroundDownloader.createDownloadAsync(uri, resultFile, requestBodyStream).done( /* Your success and error handlers */ );

Parameters

uri

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

The location of the resource.

resultFile

Type: IStorageFile

Represents the file that the response will be written to.

requestBodyStream

Type: IInputStream

A stream that represents the request entity body.

Return value

Type: IAsyncOperation<DownloadOperation>

The resultant asynchronous download operation.

Remarks

Background transfer doesn't support concurrent downloads of the same Uri. So an app can download http://example.com/myfile.wmv once, or download it again after a previous download completed. An app shouldn't start two downloads of the same Uri concurrently, since this may result in truncated files.

Requirements

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

IStorageFile
IInputStream
BackgroundDownloader

 

 

Show:
© 2014 Microsoft