Solved

JSP -> FTP Program improvement

Posted on 2004-04-02
6
285 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
  • 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
communication with a non technical owner 16 101
constructor overloading 2 79
struts exact match support 3 51
mask rule in struts validation.xml 5 85
This article shows gives you an overview on SQL Server 2016 row level security. You will also get to know the usages of row-level-security and how it works
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

867 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now