• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Displaying a file on the browser without the download box.

 
Ranch Hand
Posts: 164
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The need in my application is that i have to display an attachment in the browser to the user. Now whenever i read the file (.txt,image,.doc,.pdf etc) in a byte array and write it to the out stream of the response.
Now whenever this happens the browser by default displays the "Download box". I want to skip this.
why does this download box appears.. and how can i avoid it ?
-thanks in advance for any help.
-Kaustubh.
 
Ranch Hand
Posts: 224
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Did you set the mime types properly? If the mime type didn't set or the client doesn't know how to handle the mime type coming from the server, it shows the dialog box.
 
Kaustubh Patil
Ranch Hand
Posts: 164
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Exactly..
the type of file is a pdf. so the browser cannot display it. so it probably invokes the plug-in for the pdf. this also happens in the case of excel files.
And i guess whenever it invokes the plug-in it displays the download box ,even if the content-type is set properly.
My question is can this be overridden ?
 
reply
    Bookmark Topic Watch Topic
  • New Topic