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.
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.