This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
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

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "HTTP server -- FTP server, servlet" Watch "HTTP server -- FTP server, servlet" New topic

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);
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.

I agree. Here's the link:
subject: HTTP server -- FTP server, servlet
Similar Threads
Basic doubt on sevlets
calling two classes in the same program
Deploying from WSSD
FTP server
Accessing FTP file