I am trying to upload a byte array from Xamarin.Forms application using HttpClient. So far it's getting uploaded but I am not able to get upload progress. Is there any way to get an upload progress in percentage while file is being uploaded to server?
Here is a code snippet I am using for byte array upload.
var bytearray = videoData;
var uploadRequestBody = new ByteArrayContent(bytearray, 0, bytearray.Length);
uploadRequestBody.Headers.ContentLength = bytearray.Length;
uploadRequestBody.Headers.ContentType = new
MediaTypeWithQualityHeaderValue("video/mp4");
HttpClient uploadRequestClient = new HttpClient();
uploadRequestClient.Timeout = TimeSpan.FromMinutes(60);
var uploadRequest = new HttpRequestMessage(HttpMethod.Put, <Some URL Endpoint>);
uploadRequest.Content = uploadRequestBody;
var uploadResponse = await uploadRequestClient.SendAsync(uploadRequest);
var uploadResponseResult = uploadResponse.Content.ReadAsStringAsync().Result;
Thanks in advance.