You must Sign In to post a response.
Category: ASP.NET
#767120
The data you saved in binary format , should be fetched back in same format, for e.g. if you save PDF file in database (in binary format) then it should be fetch back in same PDF format
Now, if you save PDF file in database then you can use following code to convert it
First read binary data in Byte Array (byte[])
then run below code to display file
Thanks
Koolprasd2003
Editor, DotNetSpider MVM
Microsoft MVP 2014 [ASP.NET/IIS]
Now, if you save PDF file in database then you can use following code to convert it
First read binary data in Byte Array (byte[])
then run below code to display file
context.Response.Buffer = true;
context.Response.Charset = "";
if (context.Request.QueryString["download"] == "1")
{
context.Response.AppendHeader("Content-Disposition", "attachment; filename=" + fileName);
}
context.Response.Cache.SetCacheability(HttpCacheability.NoCache);
context.Response.ContentType = "application/pdf";
context.Response.BinaryWrite(bytes);
context.Response.Flush();
context.Response.End();
Thanks
Koolprasd2003
Editor, DotNetSpider MVM
Microsoft MVP 2014 [ASP.NET/IIS]
#767123
Hi Prasad I added the same code but still its not working
Return to Return to Discussion Forum