• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

outputStream gives wrong file name

 
sam liya
Ranch Hand
Posts: 1240
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i am trying to send a jar file to the client.
here is the code for it.but it change the file name and there is no any file type.
 
Mohamed Inayath
Ranch Hand
Posts: 124
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What error you are getting exactly?

Does the test.jar exist within files folder?
 
sam liya
Ranch Hand
Posts: 1240
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
not actually a error.
it save file named in the name of the servlet class name and without any file types(this file name is copy)
 
Ankit Garg
Sheriff
Posts: 9528
33
Android Google Web Toolkit Hibernate IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't know of any direct way of doing what you are asking for. Once I needed a similar thing, i.e. I needed a servlet to deliver dynamic excel files. So I mapped the servlet to a path like /excel/*, and then sent request to it with the URL /excel/Accounts.xls and then the servlet used to create the excel and send it to the client and is used to save with the name Accounts.xls...
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65123
91
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Check out the use of the content-disposition header.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic