The object that comes off of ReadAsByteArrayAsync().Result creates a different file than the one that was uploaded.
Here's the code:
public static HttpResponseMessage UploadVideo(HttpRequestMessage Request) {
byte[] data = Request.Content.ReadAsByteArrayAsync().Result;
BinaryWriter writer = new BinaryWriter(File.Open(@"D:/dev/test_file.mp4"));
BinaryWriter writer = new BinaryWriter(File.Open(name, FileMode.OpenOrCreate));
writer.Write(data);
writer.Flush();
writer.Close();
return new HttpResponseMessage(HttpStatusCode.Accepted);
}
This a text view of the original video file.
This is the file uploaded from ReadAsByteArrayAsync().Result
It seems like all the raw data is there except that it came with some extra strings. Can anyone explain why this is happening and how to get the original file?
Thanks