Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Connectiong to FTP site

 
krishna dey
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
when i am opening ftp://mail.ftpsitename.com it is prompting for username and password. without disclosing the username and password to the user(i will pass both username and password using a link in jsp page), i want to connect to that ftp site. how can i do that?

please help me
 
Joe Ess
Bartender
Posts: 9319
10
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you create a link on a JSP page to the FTP site containing the username and password, the user will be able to see that information, either by reading the HTML source or when they roll over the link.
You could create a proxy, where your server application connects to the server, reads the index and presents a sanitized view to the user. That way you don't need to give credentials to the user.
 
krishna dey
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for your reply,

instead of link i can use form tag and by submitting the form i can pass those parameter.that is not a problem. my problem is how to connect to that ftp server without disclosing the username & parameter.

Anyway How can i create proxy and connect to FTP server?
 
Raghavan Muthu
Ranch Hand
Posts: 3381
Mac MySQL Database Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by krishna dey:

my problem is how to connect to that ftp server without disclosing the username & parameter.


Basically there are two ways/modes to get connected to an FTP server. One is anonymous which does not require a username/password credential. The other one is authorized access for which you should provide the credentials by some means. without which it is NOT possible at all.


Anyway How can i create proxy and connect to FTP server?


You don't need to create a proxy. There are plenty of proxy servers available. Just do a google search on that. Customize it according to your need and pass the credentials and save it so that it may not ask the user everytime to enter rahter it will remember those details and enter on behalf of the user when being asked everytime he tries to connect.

Hope this helps!
 
Joe Ess
Bartender
Posts: 9319
10
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Raghavan Muthu:
You don't need to create a proxy. There are plenty of proxy servers available.


I'm not talking about a proxy server, I'm talking about the proxy design pattern. Basically you write a servlet that contacts your FTP server with the credentials and returns the user a list of files. Then the user never has access to the credentials.
The problem with your form tag plan is that a clever user will try viewing the source, and get the credentials that way. Not to mention transmitting them in the clear across the internet is about as secure as posting them on a web page.
 
Raghavan Muthu
Ranch Hand
Posts: 3381
Mac MySQL Database Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Joe Ess:


I'm not talking about a proxy server, I'm talking about the proxy design pattern.


Thank you Joe for correcting me by mentioning it explicitly .
 
Joe Ess
Bartender
Posts: 9319
10
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic