Click here to Skip to main content
11,715,022 members (62,932 online)
Rate this: bad
Please Sign up or sign in to vote.
See more: ASP.NET binary
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 9-May-12 1:49am
SAKryukov at 9-May-12 8:54am
Why "binary conversion"? What are you talking about?
NetMan2012 at 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.
SAKryukov at 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.

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

You can write the below code to achieve it:

Response.AppendHeader("Content-Disposition", "inline; filename=yourfile.pdf")
Response.ContentType = "application/pdf"

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

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 530
1 Richard MacCutchan 275
2 Maciej Los 259
3 ManasKumarM 155
4 Frankie-C 115
0 Sergey Alexandrovich Kryukov 775
1 CHill60 415
2 Richard MacCutchan 405
3 Maciej Los 389
4 OriginalGriff 320

Advertise | Privacy | Mobile
Web01 | 2.8.150901.1 | Last Updated 10 May 2012
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100