Solved

JSP -> FTP Program improvement

Posted on 2004-04-02
6
290 Views
Last Modified: 2010-04-01
Folks,

I have a web application that accesses secure binary data files on a ftp server.  (Requires a user name and password)

[CLIENT}  -- request for data file -- >  [WEBSPHERE SERVER]  -- query data file -->  [FTP Server On HOST SYSTEM]
[FTP Server On HOST SYSTEM]  -- returns data file --> [WEBSPHERE SERVER] -- returns data file  --> [CLIENT]

I would like to reduce it too
[CLIENT}  -- request for data file -- >  [WEBSPHERE SERVER]  -- query data file -->  [FTP Server On HOST SYSTEM]
[FTP Server On HOST SYSTEM]  -- returns data file  --> [CLIENT]

How can I stream the data past the web server as opposed to through it.  Is it possible??
0
Comment
Question by:bohnman
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
  • 2
6 Comments
 
LVL 7

Expert Comment

by:searlas
ID: 10742228
Not exactly, but you can send a redirect:

<% response.sendRedirect("ftp://ftp.mozilla.org"); %>

direct to a file:
<% response.sendRedirect("ftp://ftp.mozilla.org/some/file"); %>

That ends up looking like:
[CLIENT]  -- request for data file -- >  [WEBSPHERE SERVER]  -- query data file -->  send redirect -> [CLIENT]
[CLIENT] -- request data file -- > [FTP Server On HOST SYSTEM]  --  [CLIENT]
0
 
LVL 7

Assisted Solution

by:searlas
searlas earned 250 total points
ID: 10742242
Just noticed the username/password requirement.  You can redirect and include username and password, which would be idiocy.

So, no.  You cannot do this. (AFAIK)
0
 
LVL 19

Accepted Solution

by:
Kuldeepchaturvedi earned 250 total points
ID: 10742291
can't really bypass the web server...
case is.. client requested the web server so its web servers responsibility to respond to the request...
and web server requested the host... so host will be talking to web server only...!!
and I do not think its a bad idea at all!!!
in fact its a good implementation to keep the host hidden from the client....

you might redirect the stream thats coming from host to the outputstream of the request that web server have recieved from the client.....

0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:bohnman
ID: 10742465
Could you explain this a little more... I am not sure I understand what you mean

>>   you might redirect the stream thats coming from host to the outputstream of the request that web server have recieved from the client.....

0
 
LVL 19

Expert Comment

by:Kuldeepchaturvedi
ID: 10742843
well that depends how you are doing the ftp from your web server...
you might be making an external process to do the ftp in a directory and then reading the file in servlet to send it over to the client...
instead you can make a url ftp connection to the host..
like
ServletOutputStream out=response.getOutputStream();
sun.net.ftp.FtpClient fc = new FtpClient(yourhost);
fc.login(user,pwd);
fc.binary();
sun.net.TelnetInputStream in = fc.get(filename);
int k=in.read();
while(k!=-1)
{
out.write(k);
k=in.read();
}
out.flush();

//done...
Ofcourse you would need to download sun.net package for this one...
0
 

Author Comment

by:bohnman
ID: 10743656
Ok,  yeah, that is pretty much what I am doing today.  I will split the points.  Thanks for the help.
0

Featured Post

Get HTML5 Certified

Want to be a web developer? You'll need to know HTML. Prepare for HTML5 certification by enrolling in July's Course of the Month! It's free for Premium Members, Team Accounts, and Qualified Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Let's take a look back at the commercialization of the internet to understand why keeping it open and neutral is in our best interest as a society.
With the rising number of cyber attacks in recent years, keeping your personal data safe has become more important than ever. The tips outlined in this article will help you keep your identitfy safe.
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…

628 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question