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.

Forcing user to download known file types

Discussion in 'HTML & Website Design' started by msaad, Jun 15, 2005.

  1. #1
    I need the users to download a few pdfs from my site.
    The point is, I want the users, when the click on the pdfs to get a "Save as.." dialog instead of acrobat reader opening the pdf.

    This happens in, say, Yahoo mail, when you try to open an attachement with a known type (jpg, pdf,... etc). You always get a "save as." even if it is a known file type.

    How can I do this too?

    Thanks a lot in advance :)
    msaad, Jun 15, 2005 IP
  2. tresman

    tresman Well-Known Member

    Likes Received:
    Best Answers:
    Trophy Points:
    If you are in Apache, you can add a mime type for these specific files you want to be downloaded:

    I do not know if this will work for non Windows SO's, but for windows users does the work.

    you can do this in Cpanel or by adding this line to your .htaccess

    AddType application/x-msdownload pdf

    I hope this helps you.
    tresman, Jun 15, 2005 IP
  3. mopacfan

    mopacfan Peon

    Likes Received:
    Best Answers:
    Trophy Points:
    This can be done in windows as well. I did it once for jpg files so the user would be prompted to download them. I don't remember how I did it, but if you need to know how for windows, let me know and I'll go though my old files to find it.
    mopacfan, Jun 15, 2005 IP