SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    Sep 2006
    Posts
    10
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    save as pdf files prompting save as without viewing in browser

    hi,
    i want to downlad a pdf file, but in new browser they opened in browser.,
    i want to save as these files localy without diplaying in browser, when i click a link it force to prompt a save as Dialogue box so i can save it to local without viewing in browser,

    plz help me,

  2. #2
    SitePoint Author silver trophybronze trophy

    Join Date
    Nov 2004
    Location
    Ankh-Morpork
    Posts
    12,158
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You need to make the server send the appropriate HTTP header. Something like this:
    Code:
    Content-Disposition: attachment; filename=document.pdf
    You'll probably need a server-side script (PHP etc) to make this work well.
    Birnam wood is come to Dunsinane


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
  •