 |
AppletTalk.com Java discussions newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Angus Parvis Guest
|
Posted: Sun May 29, 2005 6:09 pm Post subject: downloading from servlet |
|
|
Hi,
I've programmed a servlet that reads a file from the disk and writes it
out to the servlet's output-stream. When I'm using it, the browser
suggests strange names containing the servlet's name but not the
original filename.
I guess I have to add some attribute to the outputstream to specify the
filename. Which is it? Could someone give (or point me to) an example?
Thx in advance for every help,
Angus
|
|
| Back to top |
|
 |
Real Gagnon Guest
|
Posted: Mon May 30, 2005 3:07 am Post subject: Re: downloading from servlet |
|
|
| Quote: | I've programmed a servlet that reads a file from the disk and writes it
out to the servlet's output-stream. When I'm using it, the browser
suggests strange names containing the servlet's name but not the
original filename.
I guess I have to add some attribute to the outputstream to specify the
filename. Which is it? Could someone give (or point me to) an example?
|
Try with something like
response.setHeader("Content-type","application/octetstream");
response.setHeader("Content-disposition","inline; filename=" + filename );
Bye.
--
Real Gagnon from Quebec, Canada
* Looking for Java or PB code examples ? Visit Real's How-to
* http://www.rgagnon.com/howto.html
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|