How do you force file download message box to use specified file name instead of JSP or servlet name.
I am using:
// code in attachment.jsp
With the above code, browser first pop up file download dialog box informing
'You are downloading the file:[attachment.jsp] from host. Would u like to open the file or save?'
I want the file name that I had specified in setHeader("Content-disposition","attachment;filename=resume.doc") to appear(i.e. resume.doc) in above dialog box and not the servlet name.
Any suggestions/tips on this?
Your help would be greatly appreciated.
Interesting, so you are using a servlet to get the attachment?
You could perhaps map the file name to the right servlet URL in web.xml configuration, and then use it from the web page...the browser thinks it is getting a file, but the server maps the request appropriately.
Actually, its not a physical file residing on disk that I am trying to display. Its a database BLOB that I am straming it to JSP page and I dont want to download it to disk for dislay purpose. One more thing, I am doing all this in servlets superset(i.e. JSP).
Any other alternative idea/tips?