title: Struts 2 Download - How to configure the file name dynamically?
body: <p>I am developing one application , where people will download the required file from a location mentioned in the DB to their Local. I am using struts 2 for downloading the file from the server . I can download the file without any exception and it works perfectly. 
  But the files am download has the filename i specified in struts.xml , i want it to be the exact filename which am downloading . example if the original file name is struts.pdf , i am downloading it as download.pdf, how to prevent it and download the file with actual filename</p>
  
  <p>My struts.xml configuration as follows , </p>
  
  <pre><code>&lt;action name="download" class="action.DownloadAction"&gt;
          &lt;result name="success" type="stream"&gt;
              &lt;param name="contentType"&gt;application/octet-stream&lt;/param&gt;
              &lt;param name="inputName"&gt;fileInputStream&lt;/param&gt;
              &lt;param name="contentDisposition"&gt;attachment;filename="download.log"&lt;/param&gt;
              &lt;param name="bufferSize"&gt;1024&lt;/param&gt;
          &lt;/result&gt;
          &lt;result name="error"&gt;/live/useradminerror.jsp&lt;/result&gt;
      &lt;/action&gt; 
  </code></pre>
  
  <p>And i forgot to mention am using struts2-jquery for developing the UI .Please help me in this , as am in very critical stage of my project . </p>