anag johari

anag johari

  • NA
  • 1
  • 1.2k

How to push the path of client in to YouYube Upload function

Jun 9 2013 3:09 PM
Hello All,

I am trying to upload the video on you tube. i have created one function to upload the Video on you tube.

I am using fileupload control on design page. but i am unable to access the path of client so that i can pass this path

to my video upload function. i already gone throw many forums regarding this & i get that we can't get the client video

file path due to security reason. so how can i pass the path in to the function. code is given below....

01public string UploadVideo(string FilePath, string Title, string Description)
02    {
03 
04         
05           
06             
07            settings = new YouTubeRequestSettings("Lakshya", devkey, username, password) { Timeout = -1};
08            request = new YouTubeRequest(settings);
09            Video newVideo = new Video();
10            newVideo.Title = Title;
11            newVideo.Tags.Add(new MediaCategory("Comedy", YouTubeNameTable.CategorySchema));
12            newVideo.Description = Description;
13            newVideo.Private = false;
14            newVideo.YouTubeEntry.Private = false;
15            newVideo.YouTubeEntry.MediaSource = new MediaFileSource(FilePath, "video/mp4");
16          Video createdVideo = request.Upload(newVideo);
17             
18            return createdVideo.VideoId;
19 
20 
21     }

How to pass the file path in to this function. i have fileupload control....?