What i need, is when the user clicks on the link to download the file it opens up the standard file save as / open dialog box. I tried using the Content Disposition method of doing it as specified in previous posts but it prompts the save as dialog box as soon as the page loads. I don't want to do that way. i want the dailog box to appear only on clicking the <a href> link.My servlet code which writes out the html is given below. pleaselet me know how can this be done?
This is entirely the wrong forum. JavaScript != Java.
That being said, your Content-Disposition header needs to be sent in the HTTP headers of the response to the request for the JPG, not the headers for the servlet you listed. You need to modify your web server to do that or you could write another servlet that sends the JPG with the additional header.
Can you expalin in a more detailed way how this can be done. I don't know how to modify the web server, so i guess the second option of using another servlet is better in my case.
Bookmarks