Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Jsp page instead of displaying file asking file to download

 
Raaja Gotluru
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am trying to display the files stored in server using jsp. I used the code below to display. But for pdf it is asking to download (No option for open). For XLS, XLSX, DOCX, PPT and PPTX it is showing zip file to download. For type doc it is showing junk data. What I wrong I am not getting idea. Can anyone guide me in this.


 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 35753
412
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You are saying you want to display the files "inline." This means you want the browser to display it. But a browser doesn't know how to display most of those files. Which makes you at the mercy of the computer settings for what happens. It also invites trouble. I wouldn't WANT my computer to automatically open a Word or Excel document because it could have a virus.

It would be better to say the browser should download the files (except PDF) and let the user choose whether to open it right away.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!