struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Lee, Yau-Pang" <yaupang....@citigroup.com>
Subject RE: Struts - How to Download a File
Date Tue, 04 May 2004 13:14:17 GMT
Not really struts here, more of a http question.

In your servlet you can response to the client with something like this:

response.setContentType("application/mpg");
response.setHeader("Content-disposition", "attachment; filename=" + fileName);

out = response.getWriter();
out.write(output.toString());

where output is your file....

-----Original Message-----
From: Singh_bibek [mailto:Singh_bibek@infosys.com]
Sent: Tuesday, May 04, 2004 12:58 AM
To: struts-user@jakarta.apache.org
Subject: Struts - How to Download a File


Hi All,
We wish to provide a link to the user, clicking on which user can download the file(jpg,gif,mpg,wav,tiff)
to his/her local disk.

The user should be therefore prompted for the path where the file is to be saved.

Can anyone guide me as to how to achieve the same using Struts.

Thanks,

Regards,
Bibek


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message