BackgroundDownloader.CreateDownloadAsync 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.
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.
public:
virtual IAsyncOperation<DownloadOperation ^> ^ CreateDownloadAsync(Uri ^ uri, IStorageFile ^ resultFile, IInputStream ^ requestBodyStream) = CreateDownloadAsync;
/// [Windows.Foundation.Metadata.RemoteAsync]
IAsyncOperation<DownloadOperation> CreateDownloadAsync(Uri const& uri, IStorageFile const& resultFile, IInputStream const& requestBodyStream);
[Windows.Foundation.Metadata.RemoteAsync]
public IAsyncOperation<DownloadOperation> CreateDownloadAsync(System.Uri uri, IStorageFile resultFile, IInputStream requestBodyStream);
function createDownloadAsync(uri, resultFile, requestBodyStream)
Public Function CreateDownloadAsync (uri As Uri, resultFile As IStorageFile, requestBodyStream As IInputStream) As IAsyncOperation(Of DownloadOperation)
Parameters
- resultFile
- IStorageFile
Represents the file that the response will be written to.
- requestBodyStream
- IInputStream
A stream that represents the request entity body.
Returns
The resultant asynchronous download operation.
- Attributes
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.
Note
Some file systems have file size limits. Background transfer has special logic to fast-fail transfers that exceed the destination drive's file size limits (for example, files that exceed 4GB in size for FAT32 file systems). If the server responds with a Content-Length
header value greater than the file system's maximum file size, then the download operation immediately fails with HRESULT_FROM_WIN32(ERROR_FILE_SYSTEM_LIMITATION).