简体   繁体   English

无法在Win Phone 8 3G连接上上传文件

[英]File uploading not working on Win phone 8 3G connection

I have a app in which user can record video and an api to upload recorded video to azure. 我有一个应用程序,用户可以在其中录制视频,并使用一个api将录制的视频上传到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. 仅当连接为wifi或3G视频上的连接时间少于10秒时,此功能才起作用。 When I tried to upload video of size around 20-30 MB than it fails. 当我尝试上传大小约为20-30 MB的视频时,它失败了。 In response I got status code 404 Not Found. 作为回应,我收到状态代码404 Not Found。

I also tried another way to upload but caught same error. 我也尝试了另一种上传方式,但是遇到了同样的错误。

最后,我更改了我的api代码,并发送了1 mb的请求块。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 文件上传在Win Phone 8上不起作用 - File uploading not working on Win phone 8 在桌面应用程序中的Windows 7和8中检测3G连接 - Detecting a 3G connection in Windows 7 and 8 in a desktop application 如何通过3G连接检查互联网连接状态? - How to check internet connection status over 3G connection? 故障转移到3G并返回 - Failover to 3G and back Win手机7读取XML文件 - Win phone 7 read XML file 如何在Windows Phone 7中检查3G,wifi,EDGE,蜂窝网络? - How can I check for 3G, wifi, EDGE, Cellular Networks in Windows Phone 7? 如何在不打开套接字的情况下访问Windows Phone 7特定的网络类型(例如EDGE,3G等)? - How to access Windows Phone 7 specific network type (e.g. EDGE, 3G, etc.) without opening a socket? 有没有办法检测我正在使用什么样的连接? WiFi,3G还是以太网? - Is there a way to detect what kind of connection I'm using ? WiFi, 3G or Ethernet? Google AVD和3G开启 - google avd and 3g turn on 从Windows Phone 8应用程序使用MVC Web API方法上传大文件不起作用 - Uploading large file using MVC Web API Method from Windows phone 8 app not working
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM