logo

New Response

« Return to the main article

You are replying to:

  1. I made a servlet a couple years ago that would force a download of a specific type and a specific filename... the solution that would work in all browsers was to set the url to the filename you want to download. The servlet would be an inner 'directory' to the url:

    http://host/servletname/downloadfiledirective/filename.ext?fileid=1245

    The browser would look at just the uri part (/servletname/downloadfiledirective/filename.ext) to get the filename, and some browsers would even ignore the specified content type in the response. If the filename/type is not known before the request (you just have a reference to a file), you could have a middle-man servlet to see what it is and redirect to a url including the filename.

Your Comments

Name:
E-mail:
(optional)
Website:
(optional)
Comment: