Forums Register Login

Jsp page instead of displaying file asking file to download

+Pie Number of slices to send: Send
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.


+Pie Number of slices to send: Send
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.
You can't have everything. Where would you put it?
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 3941 times.
Similar Threads
Empty browser window still exist even HttpServletResponse committed
file download servlet does not work on IE8
how to disable pop-up blocked message in IE6.0 onwards.
Problem with opening of doc file.
how to access resource file(html, text) outside war
file downoad [browser issue]
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 15:56:46.