SitePoint Sponsor

User Tag List

Results 1 to 4 of 4

Thread: download links

  1. #1
    SitePoint Enthusiast
    Join Date
    Feb 2008
    Posts
    42
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    download links

    Hi,

    Fairly simple one I think: Does anyone know how to place a link so that when clicked the user can download a pdf document (rather than opens it in the browser).

    Thanks in advance,
    cph

  2. #2
    SitePoint Guru
    Join Date
    Nov 2008
    Posts
    625
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    normally you get to download a file with extension like .doc or .xls as these files cannot be viewed directly in the web browsers.

    but pdf can be viewed in web browsers so it opens directly on clicking rather than giving visitor a option to download.

    vineet

  3. #3
    SitePoint Author silver trophybronze trophy

    Join Date
    Nov 2004
    Location
    Ankh-Morpork
    Posts
    12,158
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You'd need to send a special HTTP header (e.g., via server-side scripting or server configuration).
    Content-Disposition: attachment; filename=MyDocument.pdf

    It's not something you can do with HTML, which is a markup language.
    Birnam wood is come to Dunsinane

  4. #4
    SitePoint Enthusiast
    Join Date
    Feb 2008
    Posts
    42
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thanks


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
  •