Click here to Skip to main content
15,887,746 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi All,

In my application. I am saving pdf files in database in binary form. Now i want to get the binary content and make it open in Pdf or in Ms Word.

How i can do this? Do i need to do the binary conversion? I have no idea about it. I need your suggestions.

Thanks in advance
Posted
Comments
Sergey Alexandrovich Kryukov 9-May-12 8:54am    
Why "binary conversion"? What are you talking about?
--SA
NetMan2012 9-May-12 9:01am    
I mean how can i get the data that is stored in db in binary format and make it open in Ms Word.
Sergey Alexandrovich Kryukov 9-May-12 17:21pm    
Do you think MS Word is not binary (docx is a zipped set of XML files, basically)? What is not binary? There is no such thing. So, what is "binary conversion"?
If it's not relevant, what's the problem? Store the file content in DB, that's it.
--SA

1 solution

You can write the below code to achieve it:

VB
Response.Clear()
Response.AppendHeader("Content-Disposition", "inline; filename=yourfile.pdf")
Response.ContentType = "application/pdf"
Response.BinaryWrite(binaryData)
Response.End()
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900