Review your favorite Linux distribution.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
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.


  Search this Thread
Old 02-14-2008, 03:10 PM   #1
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


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

Rep: Reputation: Disabled
Hi -

The core Java language (i.e. "") 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

.. and ..

* Sun Tools (unsupported, but pretty standard - and very useful):

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

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:


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 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 / openSUSE 0 03-18-2005 08:11 PM
Active and Passive FTP sancho5 Linux - Networking 3 11-24-2001 09:48 PM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 02:22 PM.

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