hi ,

is following possible...

I want to read the file from the client and store it on the network
hardisk
I am getting byte by byte (for temporary reason)
here we have interanet
\\Programmer04\C\123.xml
is the location where the 123.xml file is stored.
how can i do this. can anybody improve this code...

*************************************************************
FileInputStream  xmlFileFromClient = new
FileInputStream("\\\\Programmer04\\C\\123.xml");
 FileOutputStream xmlFileSavedOnServer = new
FileOutputStream("saved.xml");

  try {

   while ( done == 1 )
   {
    int filebyteread = xmlFileFromClient.read();
    if( filebyteread == -1 )
    {
     done = 0;
    }
    else
    {
     xmlFileSavedOnServer.write(filebyteread);
    }

   }
   xmlFileSavedOnServer.close();
   xmlFileFromClient.close();

  } catch ( IOException e )
  {
   out.println("<h2>Some Problem</h2>");
  }

********************************************************

Thanks
>From : Paresh/Sachin/Narayana

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to