Search code examples
windows-phone-8windows-phonebackground-transfer

Is there ability to get uploading BackgroundTransferRequest's result?


I'm using BackgroundTransferRequest in WP8 application for uploading a file to my server. The server receives the file and send a response back with some useful info regarding uploaded file. How can I get this info?

It seems there's no API for that (shamely). Probably, I'm missing something.

Note that request.BytesReceived property returns 99 bytes, looks like request knows that some data is returned from server, but I've no idea how to get it.


Solution

  • With the great help of Eric Fleck form MSFT we found out that adding DownloadLocation and Method="Post" properties making response to be written in DownloadLocation file. So the valid request is:

    var request = new BackgroundTransferRequest(targetUri)
        {
            DownloadLocation = new Uri(downloadTo, UriKind.Relative),
            UploadLocation = new Uri(uploadFrom, UriKind.Relative),
            Method = "POST"
        };