By the way, I use the following code to write the file from slide directly to user, how could I set the content varibles so that when user saves that, the name in saving dialog is the same as file name.
InputStream input = slideClient.get(remoteFileNames[i]); response.setContentLength ( writeFile(response.getOutputStream(), input) );
// here is writeFile method private int writeFile(ServletOutputStream out, InputStream input) { int size = 0; byte [] buffer = new byte[256]; // set buffer
//read data from inputstream and output to servlet output stream try { while( true ){ int n = input.read(buffer); // read data if ( n == - 1 ) break; size += n; out.write(buffer); } }catch(IOException ioe){ // end of file }
return size; // return content size
} //private void writeFile(ServletOutputStream out, InputStream input)
Thanks a lot. Haipeng
_________________________________________________________________
Check out Election 2004 for up-to-date election news, plus voter tools and more! http://special.msn.com/msn/election2004.armx
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]