locked
BackgroundDownloader.CreateDownloadAsync working example?

    Question

  • I'm trying to understand what the 3rd parameter,IInputStream, for BackgroundDownloader.CreateDownloadAsync.

    I have read MSDN link and it tells me:

    requestBodyStream

    Type: IInputStream

    A stream that represents the request entity body.

    I thought the point of BackgroundDownloader.CreateDownloadAsync is to download from a uri into a storagefile asynchronously? Why would I need to have a inputstream of the data it should get from the uri?

    I have downloaded the sample app from msft downloader,and it doesn't have a sample of BackgroundDownloader.CreateDownloadAsync.

    Basically, I'm trying to stream download any size image files asynchronously into a storagefile. I believe BackgroundDownloader.CreateDownloadAsync is what I need to do this. Any input on what IInputStream needs to be?

    Thanks.

    Mark


    mark

    Monday, September 8, 2014 6:15 PM

Answers

  • It is used to provide an Input Stream for the non-GET HTTP request. For example, if you set the BackgroundDownloader.Method to either a POST or a PUT method (and not GET), then the Input Stream is used to provide the stream for Entity body of the POST/PUT request.

    If you are using the default HTTP GET method using BackgroundDownloader, then consider using just CreateDownload followed by a call to StartAsync (to actually start the download)

    Thanks,

    Prashant


    Windows Store Developer Solutions, follow us on Twitter: @WSDevSol|| Want more solutions? See our blog

    Monday, September 8, 2014 11:20 PM
    Moderator