• Post Reply Bookmark Topic Watch Topic
  • New Topic

Response Image to have a name

 
Timothy Sam
Ranch Hand
Posts: 751
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi guys, I generate image, image CAPTCHAs through a servlet request. Is it possible to generate a response that would put a name to the generated image so that instead of having the name generatesecuritycode.do.jpg I could have something like securitycode.jpg.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Search this and the JSP forums with keyword "Content-Disposition".
If you're interested, I have a demo app that streams images (and sets the Content-Disposition header so the images will have proper names) on my site.
http://simple.souther.us
Look for SimpleStream
 
Timothy Sam
Ranch Hand
Posts: 751
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you for your suggestion. But this seems to only work with firefox and not IE.

response.setHeader("Content-Disposition","inline;filename=securitycode.jpeg");
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!