简体   繁体   中英

How to put/post a video mp4 file on an EDS URI in C#

I want to automate an Attachment application which is set up of 2 requests :

  1. Auth requests, it will provide me a valid EDS URI.
  2. Put any type of file on EDS URI from 1st request.

Here, in the second request, I want to upload a video (MP4) file. The file is already part of the project. I tried in a way like :

string filePath = "~\\SampleVehicalVideo.mp4";

byte[] array = File.ReadAllBytes(filePath);

HttpResponseMessage response = await client.PutAsync(attachmentURI, new ByteArrayContent(array .ToArray()));

But this is not working. Please help!!!

I would like to update that, I am able to upload an mp4 file over an EDS URI with following code

byte[] array = File.ReadAllBytes(filePath);

HttpResponseMessage response = await client.PutAsync(attachmentURI, new ByteArrayContent(array .ToArray()));

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM