In html <a href> tag, how to call servlet before opening file dialog for download (save as)?

Posted by deepthinker121 on Stack Overflow See other posts from Stack Overflow or by deepthinker121
Published on 2010-04-14T09:57:18Z Indexed on 2010/04/14 10:03 UTC
Read the original article Hit count: 252

Filed under:
|
|

Hi All,

I am developing a web-app where I want to provide a download link to users - so they can download a zip file from my server. Now, my requirement is that I want to execute some processing logic contained in a servlet before displaying the file dialog to the user for 'zip' files.

So If I write

<a href="abc.zip".......>

then it opens a file dialog asking the user to select the location where this file can be saved

But if I want a servlet's doGet method to do some preprocessing - say like building the zip file , then how can I first call the servlet and then open the file dialog.

Will the following snippet work?

 <a href="MyHandlerServlet;abc.zip".......>

Thanks for your help !!

© Stack Overflow or respective owner

Related posts about html

Related posts about servlets