download a textfile from a web page 
Author Message
 download a textfile from a web page

Hi All,
In my web page with  a tags like this <a href="test.txt" > click here to
download </a>
with test.txt is a text file .
when client click on this link I'd like my client  download the file (i.e a
save dialog comes up)  instead of open the file in I.E 6

Any idea ?
TIA



Sat, 26 Jun 2004 23:44:32 GMT  
 download a textfile from a web page
Hello

As far as I am aware, using just DHTML and JScript,
security restrictions may mean that your options are
limited to using the Active X file handling abilities in
JScript.

You may have to create a Script in your web page to handle
the save of the text file once it has down loaded.

I.e.

var oFileSystem = new ActiveXObject
("Scripting.FileSystemObject");
var oFile = oFileSystem.CreateTextFile("c:\\File.txt",
true);
oFile.Write(sFileContents);
oFile.Close();

This will require the client to authorise active X objects
on his machine.

Full details of this can be found in the Microsoft
Library - Scripting Runtime.

A recent alternative may be to use the Microsoft "Dialogue
Helper" object in your web page.  You should look in the
MSDN library under Web Development - DHTML for this.

These are my suggestions anyway.

Julian

Quote:
>-----Original Message-----
>Hi All,
>In my web page with  a tags like this <a href="test.txt"
> click here to
>download </a>
>with test.txt is a text file .
>when client click on this link I'd like my client  

download the file (i.e a
Quote:
>save dialog comes up)  instead of open the file in I.E 6

>Any idea ?
>TIA

>.



Sun, 27 Jun 2004 04:20:57 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. download/save web page

2. HTTP Get/download web pages

3. Download ActiveX control from a web page

4. Download a web page

5. How download link work on a web page?

6. wsInetTools - Send Email and Download web pages

7. Automatically Download and Print Web Page

8. pass a form from web page to web page

9. Passing variables from one web page to another web page using JavaScript

10. pass a form from web page to web page

11. Page Breaks in Web Page

12. How download icon from web site?

 

 
Powered by phpBB® Forum Software