BackgroundTransferService/Request
Asked Answered
B

1

8

I have problem (in reality not one but a lot of problems),

I'm developing Windows Phone 8 App that use BackgroundTransferService for transfer recorded wav file, on HTC 8S working almost fine, but on Nokia Lumia 920 seem strange behaviour, it has some not understandable upload limit equal to 0.5MB exactly 512 KB, with WiFi it seem working fine, but this problem is over cellular.

var transferRequest = new BackgroundTransferRequest(new Uri(url, UriKind.Absolute));
transferRequest.Tag = DateTime.Now.ToString(CultureInfo.InvariantCulture);
transferRequest.Method = "POST";
transferRequest.UploadLocation = new Uri(defect.VoiceRecordFileName, UriKind.Relative);
transferRequest.TransferPreferences = TransferPreferences.AllowCellularAndBattery;

transferRequest.Headers.Add("Content-Type", "audio/wav");

transferRequest.TransferStatusChanged += new EventHandler<BackgroundTransferEventArgs>(transferRequest_TransferStatusChanged);
transferRequest.TransferProgressChanged += new EventHandler<BackgroundTransferEventArgs>(transferRequest_TransferProgressChanged);

BackgroundTransferService.Add(transferRequest);

when I reach TotalBytesSent = 512KB it stop uploading

I check this too

var tmp = NetworkInformation.GetInternetConnectionProfile();
var cost = tmp.GetConnectionCost();
var type = cost.NetworkCostType;

and everything seems fine

EDIT:

on server-side is income only 380000 Bytes +/-5 KB

And sometimes, after 10 failed starts (when send only 380KB etc.) of uploading file its suddenly upload it :D. Sometime where I am out of office it work perfectly on first time and other time never send it.

Its totally unpredictable thing

SOLUTION:

Problem was Server-Side... I had generic handler for saving this file without support of Range headers (I think). When I change my project to "Asp.NET Web Api Project" inspired/copied by this tutorial

Its doesn't work yesterday, but today its unexpectedly start working :D Crazy Nokia and .NET.

We will see tomorrow what happens next.

Bimolecular answered 8/7, 2013 at 16:34 Comment(4)
Just in case, are you sure it's 0.5 MB and not 5 MB? Because 5 MB is the transfer limit over cellular networkVirile
Yes exactly 0.5 MB, I know about 5 MB limit and I adjust limit on size of record. When I debugging this I see in "transferRequest_TransferProgressChanged" that I reach max. 0.5MB in request property "request.BytesSent" and I not understand why :). Tomorrow I will try contact some Nokia or MS evangelist to help.Bimolecular
its 50MB transfer limit over cellular and not 5MB.Arteriole
You should post your SOLUTION as an answer. It is acceptable to answer and accept your own solution.Schist
N
0

As stated by IukasChudy the solution to his problem is

Problem was Server-Side... I had generic handler for saving this file without support of Range headers (I think). When I change my project to "Asp.NET Web Api Project" inspired/copied by this tutorial

Its doesn't work yesterday, but today its unexpectedly start working :D Crazy Nokia and .NET.

We will see tomorrow what happens next.

P.S. I don't like to write an answer with content of others but I hate unanswered questions that are already solved.

Nosography answered 20/8, 2015 at 23:29 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.