Hi,

One way to do this is to set a header named content-disposition with a
value of attachment;filename=download.txt

So the raw http header would look like this:

content-disposition: attachment;filename=download.txt

This will cause your browser to open the standard open/save dialog.

How you set the header is another story! Maybe use a servlet-mapping to
map download.txt to a servlet and call response.addHeader from that
servlet.

Regards
Rob


-----Original Message-----
From: Shailender Jain [mailto:[EMAIL PROTECTED] 
Sent: 22 September 2004 09:28
To: [EMAIL PROTECTED]
Subject: File Download

Hi All,

Sorry if this slightly offline from the topic.


I want to give a download link on my browser  to the user so that
he can download a test  file from the server and save it into his local
machine
.
I have given a hyperlink to the user which points directly to the file
(download.txt)
But the problem is instead of downloading the file the contents of the
file get displayed in the browser.

What is the best way i can accomplish this?
Any help in Struts for doing this?

Thanks
Shailende Jain


______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email 
______________________________________________________________________

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to