public void ProcessRequest(HttpContext context) { int id = Int32.Parse(context.Request.Params["id"]); context.Response.ContentType = "binary"; context.Response.AddHeader("Content-Disposition", "filename=export.bin;attachment"); IEASfileAttachment engine = new IEASfileAttachment(HELPERS.NewOdbcConn_FORCE()); //context.Response. }
protected void Button1_Click(object sender, EventArgs e) { if (this.FileUpload1.HasFile) { string pathTempFolder = System.IO.Path.GetTempPath(); string pathTempFile = System.IO.Path.GetTempFileName(); FileUpload1.SaveAs(pathTempFile); IEASfileAttachment engine = new IEASfileAttachment(HELPERS.NewOdbcConn_FORCE()); int baby = engine.NewEASfileAttachment( this.FileUpload1.FileName, TXTcomment.Text, DateTime.Now, this.session.idWorkspace); engine.UploadEASfileAttachmentContent (baby, pathTempFile); Response.Redirect("PAGE_attachments.aspx?mode=success"); } }
public void ProcessRequest(HttpContext context) { int id = Int32.Parse(context.Request.Params["id"]); returnDownloadEASfileAttachmentContent down = new returnDownloadEASfileAttachmentContent(); IEASfileAttachment engine = new IEASfileAttachment(HELPERS.NewOdbcConn_FORCE()); returnGetEASfileAttachment details = engine.GetEASfileAttachment(id); context.Response.ContentType = "binary"; context.Response.AddHeader("Content-Disposition", "filename=" + details.Filename + ";attachment"); down = engine.DownloadEASfileAttachmentContent(id); context.Response.OutputStream.Write(down.Content, 0, down.Content.Length); }