I developed a java servlet that takes the query string from a html form.
For example:

<html>
<head>
<a href="/servlets/download?file1.zip">File 1</a>
</html>
</body>


Well, I click the link to call the servlet.  The servlet takes the query
string and appends it to the path were the file is loacted.  See code below:

res.setContentType("application/x-zip-compressed");

// Grab the query string passed in.
String strQueryString = req.getQueryString();

res.setHeader("Content-Disposition","filename=" + strQueryString + ";");
ServletOutputStream out = res.getOutputStream();

String  str_updateFile = "/home/httpd/bin/" + strQueryString;

// Try to read in the update file information.
try
{
        String fileLine;
        FileInputStream finStream = new FileInputStream(str_updateFile);
        int i;

        while((i = finStream.read()) != -1)
        {
                out.write(i);
        }
        finStream.close();
}
catch(IOException e){}

out.close();


The problem in the file download dialog box. from Internet Explorer.  When
the servlet starts the download I get the following description:

You have chosen to download a file from this location

"...Updates?OasisEdit.1.4.0.3.zip from [server name here]"

How come the "...Updates?File1.zip" show up like this.  I want it to look
like:

"File1.zip from [server name here]"

Any suggestions????

Thanks
LHoffman

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
FAQs on JSP can be found at:
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html

Reply via email to