0

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.

Lundin
  • 195,001
  • 40
  • 254
  • 396
mayank.karki
  • 750
  • 1
  • 9
  • 34

1 Answers1

0

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

mayank.karki
  • 750
  • 1
  • 9
  • 34