1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Triggering automatic download when on a webpage

Discussion in 'HTML & Website Design' started by vicktard, Jan 18, 2011.

  1. #1
    Hi! I'm a novice and designing my first webpage. I'm hosting with GoDaddy and can't seem to get a function to work. I have uploaded a .pdf file and would like for it to prompt a user to download the .pdf file when landing on the page specified; ie: "website.com/downloads/champion.pdf"

    and being able to download the file champion.pdf when landing on that page. Any suggestions? Thank you!
     
    vicktard, Jan 18, 2011 IP
  2. AHEINC

    AHEINC Peon

    Messages:
    22
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    You could create a pop-up window with a link to the pdf you want them to download. You will find the code you need here - http://www.javascript-coder.com/window-popup/javascript-window-open.phtml.

    However, you need to remember that majority of users disable pop-up windows because of the security issues. In fact, forcing your user to download anything automatically may only cause irritation and they will leave as soon as they will see it. If your pdf contains some important information try to display it promptly on a website, encouraging them to download. People don't like being to force to do anything..;-)
     
    AHEINC, Jan 19, 2011 IP
  3. vicktard

    vicktard Member

    Messages:
    27
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    46
    #3

    Thank you for your response, AHEINC. I was thinking more along the lines of having a link sent to them via email and when they click the link, it automatically will prompt them to download the file that they would like. I've asked around and gotten a couple of responses. Now I've gotten the page to work, but no download is prompted. The title is "Macworld02-11.pdf (application/pdf Object)." I'm familiar with this title, as it's trying to open the file, but it doesn't prompt a download. Is there a command to fix this issue? Thanks again for the tips.
     
    vicktard, Jan 19, 2011 IP
  4. GWiz

    GWiz Peon

    Messages:
    359
    Likes Received:
    17
    Best Answers:
    0
    Trophy Points:
    0
    #4
    The issue here isn't your file, but your browser. Your browser has the Adobe Reader plugin to automatically open PDF files in your browser. If a user doesn't have this addon, they will be prompted to download the file to their computer.

    However if this isn't satisfactory and you want to force users to download a file, you can setup a php script to make this happen:
    http://nspeaks.com/656/force-file-downloads-instead-of-opening/

    Not sure if this will work for you, but you can always do a google search for "Force users to download PDF file".
     
    GWiz, Jan 19, 2011 IP
  5. vicktard

    vicktard Member

    Messages:
    27
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    46
    #5
    Haven't been to this thread in a while, but thanks for your advice, it helped a lot! ;)
     
    vicktard, Apr 10, 2011 IP