File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

servletOutputStream

 
carlos sanchez
Ranch Hand
Posts: 45
  • 0
  • 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
  • 0
  • 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.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic