Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

servletOutputStream

 
carlos sanchez
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I'm using a servlet to extract files from a content management app. People click the link and call my servlet that sets the response.setContentType to image/jpg , problem is that I get the Open From location or download to file box.
I've tried with gif, png and pdf and it works correctly. What's the problem?
 
Frank Carver
Sheriff
Posts: 6920
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The bit you have missed is that the correct mime type is image/jpeg
Although you may wish to store the file as something.jpg, you should always check if the mime type is different from the file extension.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic