...

View Full Version : "a href=" Download Problem Please help



atstone1997
05-23-2005, 08:12 PM
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

_Aerospace_Eng_
05-23-2005, 09:11 PM
This might help you get in the right direction.
Here is text.php

<?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

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.

atstone1997
05-23-2005, 10:52 PM
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.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum