[英]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.