when i log into slide as url http://localhost:8080/slide/, with user root, password root. everything is fine. but when i list the content under this folder, it throws exception. if i log into http://localhost:8080/slide/files with the same user and password, evetything is good. there is no exception when i list the contents of that folder. It is so strange. Could somebody help me?
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]



Reply via email to