aspose file tools*
The moose likes Servlets and the fly likes HTTP server -- FTP server, servlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "HTTP server -- FTP server, servlet" Watch "HTTP server -- FTP server, servlet" New topic
Author

HTTP server -- FTP server, servlet

Edward Chen
Ranch Hand

Joined: Dec 23, 2003
Posts: 798
Hi, I have one HTTP server and one FTP server, but they both are located in different computers with different IP addresses. My question is : how the HTTP server fetch a file from FTP server and send back to client?
The servelet like this:
public void doService(....) {
// how to say the "address"
String address = "???/file.doc";
File file = new File(address);
out.sendback(file);
}
Thanks.
Edward
Nathaniel Stoddard
Ranch Hand

Joined: May 29, 2003
Posts: 1258
Well, not that this is really a Servlet issue, but you COULD just send a redirect to the actual file on the correct server.
Alternatively, you could retrieve the actual file with some programming (think Jakarta Commons Net), and then return it just like you would any normal binary stream.


Nathaniel Stodard<br />SCJP, SCJD, SCWCD, SCBCD, SCDJWS, ICAD, ICSD, ICED
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: HTTP server -- FTP server, servlet