Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    May 2005
    Location
    Arizona
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    "a href=" Download Problem Please help

    Hello, and thanx in advance for the help.
    I have a line in my html that is as follows:

    <a href="mad_<%=sVNumber%>.fil">Click here to Download Activation File</a>

    This is on a web page on our company's local intranet, on some computers within the network the open save dialog box displays once clicking on the link. On others the file which is a text document is displayed in internet explorer. I need the file to always download. I tried the file method by the file isn't stored locally on the user's computer. It's on the server where the web page is ran from.

    Please Help
    Toby Stone

  • #2
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    This might help you get in the right direction.
    Here is text.php
    PHP Code:
    <?php
    header
    ('Content-type: text/plain');
    header('Content-disposition: attachment; filename="test.txt"');
    readfile('[text.php]');
    ?>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <title>Untitled Document</title>
    </head>

    <body>

    </body>
    </html>
    here is test.txt
    Code:
    This should be downloaded.
    If you link directly to text.php, a dialog box will be prompted to download the text file if your server supports this, I no reason why it shouldn't. Also this should be in the php forum, don't repost it, a mod will move this for you.

  • #3
    New to the CF scene
    Join Date
    May 2005
    Location
    Arizona
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Reply:

    Actually the file name changes each time the web site is addressed. Your response seems a little to complicated to what I was attempting to accomplish. I've been trying to determine if there are settings that are incorrect in either IIS, or internet explorer, or the users registry. I don't think re-enginering the way the website currently functions is the proper answer. But I thank you for a response.


  •  

    Posting Permissions

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