public void ProcessRequest(HttpContext context) { int docID = 0; DocumentDA objDocDA = new DocumentDA(); if (context.Request["ID"] != null) { docID = Convert.ToInt32(context.Request["ID"]); DocAccess objDocAccess = new DocAccess(); byte[] fileContents = objDocAccess.FileToByteArray(docID); if (fileContents != null) { context.Response.AppendHeader("Content-Type", "video/mp4"); context.Response.AppendHeader("Accept-Ranges", "bytes"); context.Response.OutputStream.Write(fileContents, 0, fileContents.Length); context.Response.Flush(); } else { context.Response.ContentType = "image/jpeg"; if (File.Exists(Constant.DocRepRoot + "blankVideoTN.png")) context.Response.WriteFile(Constant.DocRepRoot + "blankVideoTN.png"); else context.Response.WriteFile(Constant.DocRepRoot + "NoDocs.png"); } } }
private void showPicture(int docID, int imgCount, string imgType) { //RadBinaryImage rimg = (RadBinaryImage)this.FindControl("Thumbnail" + imgCount.ToString()); RadBinaryImage rimg = (RadBinaryImage)this.FindControl("Thumbnail1"); if (rimg != null) { if (imgType.ToUpper() == "LOGO") { rimg.Width = Unit.Pixel(200); rimg.Height = Unit.Pixel(150); } else { rimg.Width = Unit.Pixel(750); rimg.Height = Unit.Pixel(180); } DocAccess objDocAccess = new DocAccess(); rimg.DataValue = objDocAccess.FileToByteArray(docID); } }