Hello everyone, These days I am working on a project, and I am facing some problem in it. The thing is that I need to display some results as a result of the database query, and I need to provide a link so that user can download the file by clicking on it. I want to dynamically assign the file-name (as default) and the file I am retriving is from database it self. Can anyone help me with the solution of how to do this. Thanks & Regards, Varun Narang.
Your computer system is like AC, it's of no use when you open Windows ;)
There is a "Content-Disposition" header that allows you to send filename that you can allow your users to download.
It should be something like this - response.setHeader("Content-Disposition", "attachment; filename=" + fileName);
where fileName is the dynamic filename that you want. Do remember to set MIME type accordingly for the file.
HTH, - Manish
Joined: Nov 19, 2004
Thanks Mr. Hatwalne, That was a great help. Thanks a lot once again.
In the mean time, I was playing with Initialization parameters, I found something really strange. It's about case-sensitivity of param-names. The case is as follows: If in web.xml file of my application, while specifying <init-param> tag for Servlet, I specify string for <param-name> in INITCAP, I am not able to retrive the value of <param-value> when I use getServletConfig().getInitParameter("Initcap-word"). Is this a bug, or contradicting the conventions. Can anyone tell me about that? Thanks in Advance, Regards, Varun Narang.
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
subject: How to Specify the dynamic name for setting a file for downloading?