SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Member
    Join Date
    Aug 2006
    Posts
    7
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How to open a PDF?

    Hello again! Can someone tell me how can I open a PDF wich I store the path in a Access DB, passing the corresponding ID along the query string? I'm working with VB in .NET 1.1 .



    Thanx in advance.

  2. #2
    SitePoint Mentor NightStalker-DNS's Avatar
    Join Date
    Jul 2004
    Location
    Cape Town, South Africa
    Posts
    2,880
    Mentioned
    48 Post(s)
    Tagged
    0 Thread(s)
    What exactally do u mean open it? As in u wana open it in asp.net to work on it or open it in the broswer for a user to see?

    If open it in a browser. Just redirect to that filename.

  3. #3
    SitePoint Member
    Join Date
    Aug 2006
    Posts
    7
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Heloo!
    Yes, I wanna open it in the browser for the user to see, but I don't want to redirect directly to the filename but though the DB field. Like:

    Response.WriteFile("DB_field")
    instead of Response.WriteFile(file.fullName)

    Is there a way to do this?

  4. #4
    SitePoint Member
    Join Date
    Aug 2006
    Posts
    7
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I made it!!!

    I just droped MapPath and coded like this:

    Dim RecID
    Dim strPath
    Dim ImagePath
    ImagePath="c:\inetpub\wwwroot\pessoal\docs\"
    RecID=Request.QueryString("id")
    strPath = imagePath & RecID & ".pdf"
    Response.ClearContent()
    Response.ClearHeaders ()
    Response.ContentType = "application/pdf"
    Response.WriteFile(StrPath)
    Response.Flush()
    Response.Close()

    I found the solution in here:
    http://www.thescripts.com/forum/thread51090.html

    Thanx anyway. You always help a lot!

    C U


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •