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.

Tharif
  • 13,794
  • 9
  • 55
  • 77
lukasChudy
  • 83
  • 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 network – Kevin Gosse Jul 08 '13 at 17:32
  • 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. – lukasChudy Jul 08 '13 at 18:59
  • its 50MB transfer limit over cellular and not 5MB. – Isaiyavan Babu Karan Jul 18 '13 at 11:22
  • You should post your **SOLUTION** as an answer. It is acceptable to answer and accept your own solution. – Joshua Drake May 13 '15 at 19:52

1 Answers1

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.

Community
  • 1
  • 1
csharpwinphonexaml
  • 3,659
  • 10
  • 32
  • 63