How to read file from remote machine

Hello,Hi, i would like to know how to read text file from remote machine using java source code, any code ?Thanks very much;Best regardsKim
[174 byte] By [YoongKima] at [2007-10-2 6:46:00]
# 1

On the server, perform the following steps:

> Parse the request and determine the file to serve

> Open a FileInputStream to the appropriate file

> Obtain a reference to the Servlet OutputStream

> Pipe the bytes from the file to the output stream

> Flush and close the stream

You might want to call HttpServletResponse.setContentType("application/octet") to indicate to the browser that a file download will be occurring. Do so before getting the reference to the Servlet's OutputStream.

- Saish

Saisha at 2007-7-16 13:54:34 > top of Java-index,Administration Tools,Sun Connection...