SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    Mouse catcher silver trophy
    Stevie D's Avatar
    Join Date
    Mar 2006
    Location
    Yorkshire, UK
    Posts
    5,829
    Mentioned
    110 Post(s)
    Tagged
    1 Thread(s)

    Force browsers to download rather than display

    On one of my websites, I've got some .gpx files that visitors can download. These are XML files that interface with GPS devices. The problem is that when a visitor clicks on the link to the file, it opens up as raw XML in the browser. That isn't very helpful!

    Is there any way to configure the server so that visitors who click on the link are prompted to download the .gpx file rather than opening it in the browser?

  2. #2
    Certified Ethical Hacker silver trophybronze trophy dklynn's Avatar
    Join Date
    Feb 2002
    Location
    Auckland
    Posts
    14,604
    Mentioned
    19 Post(s)
    Tagged
    2 Thread(s)
    SD,

    Is this YOUR server or are you sharing with others? If it's yours, you should be able to remove the AddType statement for the .gpx files (from httpd.conf). If not, you could link to a download script which would have the same problem unless you zipped the .gpx. Is it worth all that?

    Regards,

    DK
    David K. Lynn - Data Koncepts is a long-time WebHostingBuzz (US/UK)
    Client and (unpaid) WHB Ambassador
    mod_rewrite Tutorial Article (setup, config, test & write
    mod_rewrite regex w/sample code) and Code Generator

  3. #3
    SitePoint Evangelist ferrari_chris's Avatar
    Join Date
    Mar 2008
    Location
    NP, New Zealand
    Posts
    576
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Depending on your server side language, there are code based solutions that can do this, rather than a server based solution.

    Is that an option for you, or do you have 1000 links to modify, so a code based solution isn't appropriate?

  4. #4
    Mouse catcher silver trophy
    Stevie D's Avatar
    Join Date
    Mar 2006
    Location
    Yorkshire, UK
    Posts
    5,829
    Mentioned
    110 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by dklynn View Post
    Is this YOUR server or are you sharing with others? If it's yours, you should be able to remove the AddType statement for the .gpx files (from httpd.conf). If not, you could link to a download script which would have the same problem unless you zipped the .gpx. Is it worth all that?
    Oops, have just realised that this site is one where I don't have all that much control over the server settings, and certainly can't change httpd.conf I forgot which site I was working on...

    Thanks for your suggestions, but I think I might have to carry on with the current system of "hoping anyone using a GPS is smart enough to right click and choose 'Download/Save target'"...

  5. #5
    Certified Ethical Hacker silver trophybronze trophy dklynn's Avatar
    Join Date
    Feb 2002
    Location
    Auckland
    Posts
    14,604
    Mentioned
    19 Post(s)
    Tagged
    2 Thread(s)
    SD,

    I have a client with a website which offers MP3 downloads to radio stations. The station owners who merely click on the link will get their (browser installed) MP3 player to download and play the file so I've "reminded" them to RIGHT CLICK to SaveAs immediately under the link. If they don't bother to read that, then they deserve the problems they get by blindly clicking away!

    Regards,

    DK
    David K. Lynn - Data Koncepts is a long-time WebHostingBuzz (US/UK)
    Client and (unpaid) WHB Ambassador
    mod_rewrite Tutorial Article (setup, config, test & write
    mod_rewrite regex w/sample code) and Code Generator


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
  •