public void UpdateVideo()
 {
     try
     {
         VirtualVideo objVideo = VirtualTourController.GetVirtualVideosById(VirtualId);
         VideoFile     = fileUpldVideo;
         objVideo.name = txtName.Text;
         if (VideoFile.HasFile)
         {
             if (VideoFile.PostedFile.ContentType == "video/mp4")
             {
                 string fileName = Path.GetFileName(VideoFile.FileName);
                 string path     = "~/Videos/" + fileName;
                 VideoFile.SaveAs(Server.MapPath(path));
                 objVideo.path        = path;
                 objVideo.ContentType = "video/mp4";
             }
             else
             {
                 ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "err_msg", "MessageBox('Error','Please Select MP4 Video File');", true);
             }
         }
         objVideo = new VirtualTourController().UpdateVideos(objVideo);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
 public void BindValues()
 {
     try
     {
         VirtualVideo objVideo = VirtualTourController.GetVirtualVideosById(VirtualId);
         txtName.Text  = objVideo.name;
         editVideo.Src = objVideo.path;
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Example #3
0
 public string GetSource(long Id)
 {
     try
     {
         string       src      = "";
         VirtualVideo objVideo = VirtualTourController.GetVirtualVideosById(Id);
         src = objVideo.path;
         return(src);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Example #4
0
        public void ProcessRequest(HttpContext context)
        {
            int id = int.Parse(context.Request.QueryString["Id"]);

            byte[] bytes = new byte[10];
            string contentType;
            string name;

            VirtualVideo objVideo = VirtualTourController.GetVirtualVideosById(id);

            // bytes = objVideo.data;
            contentType = objVideo.ContentType;
            name        = objVideo.name;

            context.Response.Clear();
            context.Response.Buffer = true;
            context.Response.AppendHeader("Content-Disposition", "attachment; filename=" + name);
            context.Response.ContentType = contentType;
            context.Response.BinaryWrite(bytes);
            context.Response.End();
        }