File uploading not working on Win phone 8 3G connection

荒凉一梦 提交于 2019-12-25 03:29:13

问题


I have a app in which user can record video and an api to upload recorded video to azure. I am using below code

HttpClientHandler handler = new HttpClientHandler();
handler.MaxRequestContentBufferSize = int.MaxValue;
using (HttpClient httpClient = new HttpClient(handler) 
   { 
        MaxResponseContentBufferSize = int.MaxValue
   })
{
  MultipartFormDataContent content = new MultipartFormDataContent();
  content.Add(new ByteArrayContent(chunks), "file", fileName);
  HttpResponseMessage response = null;
  response = await httpClient.PostAsync(new Uri(url), content);
  return await response.Content.ReadAsStringAsync();
}

This is working only when either connection is wifi or on 3G video is less than of 10 sec. When I tried to upload video of size around 20-30 MB than it fails. In response I got status code 404 Not Found.

I also tried another way to upload but caught same error.


回答1:


At last, I have changed my api code and send request with 1 mb chunks.



来源:https://stackoverflow.com/questions/25239160/file-uploading-not-working-on-win-phone-8-3g-connection

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!