@@ -175,17 +175,19 @@ public async Task Sample()
175
175
client .DefaultRequestHeaders .Remove (" Ocp-Apim-Subscription-Key" );
176
176
177
177
// Upload a video
178
- var content = new MultipartFormDataContent () ;
178
+ MultipartFormDataContent content = null ;
179
179
Console .WriteLine (" Uploading..." );
180
+
180
181
// Get the video from URL
181
182
var videoUrl = " VIDEO_URL" ; // Replace with the video URL
182
183
183
184
// As an alternative to specifying video URL, you can upload a file.
184
185
// Remove the videoUrl parameter from the query parameters below and add the following lines:
185
- // FileStream video =File.OpenRead(Globals.VIDEOFILE_PATH);
186
- // byte[] buffer =new byte[video.Length];
186
+ // content = new MultipartFormDataContent();
187
+ // FileStream video = File.OpenRead(@"c:\videos\democratic3.mp4");
188
+ // byte[] buffer = new byte[video.Length];
187
189
// video.Read(buffer, 0, buffer.Length);
188
- // content.Add(new ByteArrayContent(buffer));
190
+ // content.Add(new ByteArrayContent(buffer), "MyVideo", "MyVideo" );
189
191
190
192
queryParams = CreateQueryString (
191
193
new Dictionary <string , string >()
@@ -398,16 +400,16 @@ namespace VideoIndexerArm
398
400
var client = new HttpClient (handler );
399
401
400
402
// Upload a video
401
- var content = new MultipartFormDataContent () ;
403
+ MultipartFormDataContent content = null ;
402
404
Console .WriteLine (" Uploading..." );
403
- // Get the video from URL
404
405
405
406
// As an alternative to specifying video URL, you can upload a file.
406
407
// Remove the videoUrl parameter from the query parameters below and add the following lines:
407
- // FileStream video =File.OpenRead(Globals.VIDEOFILE_PATH);
408
- // byte[] buffer =new byte[video.Length];
409
- // video.Read(buffer, 0, buffer.Length);
410
- // content.Add(new ByteArrayContent(buffer));
408
+ // content = new MultipartFormDataContent();
409
+ // FileStream video = File.OpenRead(@"c:\videos\democratic3.mp4");
410
+ // byte[] buffer = new byte[video.Length];
411
+ // video.Read(buffer, 0, buffer.Length);
412
+ // content.Add(new ByteArrayContent(buffer), "MyVideo", "MyVideo");
411
413
412
414
var queryParams = CreateQueryString (
413
415
new Dictionary <string , string >()
0 commit comments