Re: Showing PDF documents from a SQL Database

Discussion in 'ASP .Net' started by dave wanta, Jul 3, 2003.

  1. dave wanta

    dave wanta Guest

    This is just off the top of my head, so let me know if it doesn't work. Be
    gentle <grin>

    Once you have the pdf bytes from the database, something like this *should*
    work

    byte[] bytes = GetPdfBytes(); //your function that gets the bytes from sql
    server
    Response.ContentType = "application/pdf"; //you may need to check the
    exact Mime type of a pdf doc
    Response.OutputStream.Write( bytes, 0, bytes.Length );
    Response.End();

    Cheers!
    Dave
    www.aspNetPOP3.com
    "Chris Roden" <> wrote in message
    news:052101c3410a$81453260$...
    > I have PDF documents stored in a SQL Database. How can I
    > display the PDF document straight from the database
    > without creating a file?
    >
    > Chris Roden
    >
    dave wanta, Jul 3, 2003
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    2
    Views:
    933
  2. =?Utf-8?B?c2FtZWVy?=

    Showing documents stored in the database in the browser

    =?Utf-8?B?c2FtZWVy?=, Oct 13, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    309
    Steve C. Orr [MVP, MCSD]
    Oct 14, 2006
  3. Replies:
    1
    Views:
    469
    Juan T. Llibre
    Oct 18, 2006
  4. desaitapan1
    Replies:
    0
    Views:
    2,059
    desaitapan1
    Dec 29, 2010
Loading...

Share This Page