Okay, I found out how to do it:
To download:
Response.ContentType = dsPDF.Tables[0].Rows[0]["strPDFFileWordMime"].ToString();
Response.OutputStream.Write( (byte[])dsPDF.Tables[0].Rows[0]["imgPDFFileWordDoc"], 0, Convert.ToInt32(dsPDF.Tables[0].Rows[0]["intPDFFileWordLength"]));
Response.AddHeader("Content-Disposition", "attachment;filename=" + dsPDF.Tables[0].Rows[0]["strPDFFileWordName"].ToString());
Response.Flush();
Response.End();
|
and to Display:
Response.ContentType = dsPDF.Tables[0].Rows[0]["strPDFFileWordMime"].ToString();
Response.OutputStream.Write( (byte[])dsPDF.Tables[0].Rows[0]["imgPDFFileWordDoc"], 0, Convert.ToInt32(dsPDF.Tables[0].Rows[0]["intPDFFileWordLength"]));
Response.AddHeader("Content-Disposition", "inline;filename=" + dsPDF.Tables[0].Rows[0]["strPDFFileWordName"].ToString());
Response.Flush();
Response.End();
|
it's the word inline in the header that makes it work.