LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 02-14-2008, 03:10 PM   #1
kshkid
Member
 
Registered: Dec 2005
Distribution: RHEL3, FC3
Posts: 383

Rep: Reputation: 30
ftp - active or passive mode


Hi All,

Here is a question about active (PORT) and passive (PASV) connection modes in ftp.

When I run ftp command from command prompt manually,

default connection mode is passive.
I have to issue *passive* command to toggle to *active* mode.

Will this be the same behavior if that is done programmatically ?
What is the default connection mode if the server accessed via java code ?

Do I need to explicitly mention it as below

Code:
client.enterLocalActiveMode();
?

thanks
 
Old 02-15-2008, 09:27 PM   #2
paulsm4
Guru
 
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
Hi -

The core Java language (i.e. "java.net") doesn't *have* any classes specifically for FTP. You get to write one of your own (it's not difficult), or use some other, 3rd party class.

Two Pop Favorites are:

* Apache Commons
http://commons.apache.org/

.. and ..

* Sun Tools (unsupported, but pretty standard - and very useful):
http://www.nsftools.com/tips/JavaFtp.htm

You chose the former. The documentation - and complete source code - are on-line. That's probably the easiest way to answer your question.

PS:
Whether an FTP client is active or passive depends entirely on the client - different "ftp" commands will all behave differently.

Here's a good tutorial:
http://www.enterprisedt.com/publicat..._Overview.html
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
VSFTPD question...active/passive mode lapzlinux Linux - Networking 4 08-06-2011 01:54 AM
difference between active FTP and Passive FTP prashsharma Linux - Server 2 05-11-2007 01:05 AM
FTP: active and passive mode problem with some windows client tda71 Linux - Networking 2 06-14-2005 08:31 AM
Passive/Active mode in Konqueror & .netrc perl21 Suse/Novell 0 03-18-2005 08:11 PM
Active and Passive FTP sancho5 Linux - Networking 3 11-24-2001 09:48 PM


All times are GMT -5. The time now is 01:35 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration