Results 1 to 3 of 3
  1. #1
    Join Date
    Oct 2004
    Location
    Paris, FRANCE
    Posts
    132

    Unanswered: HTTP download file

    I'd like to know the best way to put a file download, I'm thinking about 3 means:
    - directly put the file URI in a <a> (<a href="file_to_download">file</a>)
    - calling a file downloader page like (<a href="download_file.php?id=1112335453">file</a>)
    - make javascript send the new header to the current page to force the download without refreshing the page

    The last one seems cool but I don't know if it's possible nor to do it.
    Do someone have example(s)

  2. #2
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    The javascript variant may well be "cool", but I wouldnt deploy that version only, enless you know with absolute certainty that ALL viewers of your webpage who want to downlaod this file have Javascript enabled. One of the recurring issues with web development is that you cannot predict or control what viewers are usign or want to do. Unless you have a killer website that can dictate the technology that the viewer uses then Id Id alwasy make certain that there is a non Javascript method.

    So its up to you... the Javascript method maybe cool, but you possibly ought to consider a secondary backup method
    I'd rather be riding on the Tiger 800 or the Norton

  3. #3
    Join Date
    Oct 2004
    Location
    Paris, FRANCE
    Posts
    132
    Yes you are right it's important to make it runnable with all the browsers.
    But so how do we usually do ?
    The problem with the first method is that many browser will try to open
    the document itself instead of bringing up the download dialog box.
    I'd like to force the download.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •