Hi,
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
<%
response.setContentType(mimeType.trim());
response.setHeader("Content-Disposition","attachment;filename=\""+attachmentViewBean.getAttachmentName()+ "\"");
%>
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.
Thanks,
Yogesh
-
File download dialog box problem! (2 messages)
- Posted by: Yogesh Gowdra
- Posted on: January 10 2002 21:03 EST
Threaded Messages (2)
- File download dialog box problem! by Toby Hede on January 11 2002 17:39 EST
- File download dialog box problem! by Yogesh Gowdra on January 11 2002 17:55 EST
-
File download dialog box problem![ Go to top ]
- Posted by: Toby Hede
- Posted on: January 11 2002 17:39 EST
- in response to Yogesh Gowdra
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. -
File download dialog box problem![ Go to top ]
- Posted by: Yogesh Gowdra
- Posted on: January 11 2002 17:55 EST
- in response to Toby Hede
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?