Hi,
   question here is not to optimize the code
but the local intranet zone's file is not accessible.

how to that.

it throws the following exception when i run the servlet....
 

500 Internal Server Error
The servlet named sunexamples.ReadFileServlet at the requested URL

http://localhost:8080/servlet/sunexamples.ReadFileServlet
reported this exception: file://programmer04//C//123.xml. Please report this to the administrator of the web server.

java.io.FileNotFoundException: file://programmer04//C//123.xml at java.lang.Throwable.(Compiled Code) at java.lang.Exception.(Compiled Code) at java.io.IOException.(Compiled Code) at java.io.FileNotFoundException.(Compiled Code) at java.io.FileInputStream.(Compiled Code) at sunexamples.ReadFileServlet.doGet(Compiled Code) at javax.servlet.http.HttpServlet.service(Compiled Code) at javax.servlet.http.HttpServlet.service(Compiled Code) at com.sun.server.ServletState.callService(Compiled Code) at com.sun.server.ServletManager.callServletService(Compiled Code) at com.sun.server.http.servlet.InvokerServlet.service(Compiled Code) at javax.servlet.http.HttpServlet.service(Compiled Code) at com.sun.server.ServletState.callService(Compiled Code) at com.sun.server.ServletManager.callServletService(Compiled Code) at com.sun.server.ProcessingState.invokeTargetServlet(Compiled Code) at com.sun.server.http.HttpProcessingState.execute(Compiled Code) at com.sun.server.http.stages.Runner.process(Compiled Code) at com.sun.server.ProcessingSupport.process(Compiled Code) at com.sun.server.Service.process(Compiled Code) at com.sun.server.http.HttpServiceHandler.handleRequest(Compiled Code) at com.sun.server.http.HttpServiceHandler.handleRequest(Compiled Code) at com.sun.server.HandlerThread.run(Compiled Code)
 

Can u resolve the problem
Thanks
Paresh
************-*--------------------*-***********************
Madan Raj M wrote:

Hi,
    this code will perform better.
        while ((filebyteread = xmlFileFromClient.read()) != -1)
xmlFileSavedOnServer.write(filebyteread)
    Any other ideas?
madan

----- Original Message -----
From: P <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, March 23, 2000 3:35 PM
Subject: hi bie ! ... Is this possible...

> 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

___________________________________________________________________________
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