AppletTalk.com Forum Index AppletTalk.com
Java discussions newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

downloading from servlet

 
Post new topic   Reply to topic    AppletTalk.com Forum Index -> Java Language Programming
View previous topic :: View next topic  
Author Message
Angus Parvis
Guest





PostPosted: Sun May 29, 2005 6:09 pm    Post subject: downloading from servlet Reply with quote



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





PostPosted: Mon May 30, 2005 3:07 am    Post subject: Re: downloading from servlet Reply with quote



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
Display posts from previous:   
Post new topic   Reply to topic    AppletTalk.com Forum Index -> Java Language Programming All times are GMT
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.