473,396 Members | 1,879 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Passive FTP

I know this is not really the right forum for this topic, but I figured
there are a lot of people here who may be able to provide me with an answer
to my question so I would give it a try.

About a year ago I wrote an FTP client in C#. It supported only 'Active'
mode as that was my requirement at the time; however I now need to support
'Passive' mode.

From what I can see, this simply means that you ask the server for the
details of the port to which the data connection should be made by using the
PASV command and then open an outbound connection to the server on the port
specified to transfer data across. Nothing else changes.

I have done this, and to a certain extent it works. I issue the PASV
command, open a connection to the port specified by the server and send the
data. I then close the connection. At this point, I get a 426 error,
Connection Closed, transfer aborted.

I figure I am missing something but cannot fathom what it is. Should I be
sending any additional messages to the server to indicate that the transfer
is complete?

Any help will be gratefully accepted.

Thanks.

Jul 21 '05 #1
2 1826
PASSIVE (PASV)
This command requests the server-DTP to "listen" on a data
port (which is not its default data port) and to wait for a
connection rather than initiate one upon receipt of a
transfer command. The response to this command includes the
host and port address this server is listening on.
"Martin Robins" <martin - robins @ ntlworld dot com> wrote in message
news:eg****************@TK2MSFTNGP12.phx.gbl...
I know this is not really the right forum for this topic, but I figured
there are a lot of people here who may be able to provide me with an answer to my question so I would give it a try.

About a year ago I wrote an FTP client in C#. It supported only 'Active'
mode as that was my requirement at the time; however I now need to support
'Passive' mode.

From what I can see, this simply means that you ask the server for the
details of the port to which the data connection should be made by using the PASV command and then open an outbound connection to the server on the port specified to transfer data across. Nothing else changes.

I have done this, and to a certain extent it works. I issue the PASV
command, open a connection to the port specified by the server and send the data. I then close the connection. At this point, I get a 426 error,
Connection Closed, transfer aborted.

I figure I am missing something but cannot fathom what it is. Should I be
sending any additional messages to the server to indicate that the transfer is complete?

Any help will be gratefully accepted.

Thanks.

Jul 21 '05 #2
Bryan,

I understand this. The server listens on a port and sends the details of
that port to the client in order that the client initiate the data
connection to that specified port - in active mode the client specifies the
port and the server connects to it.

My problem is that when I close the socket connected to the port specified
by the 227 reply after sending the data over it, for example when uploading
file to the server, the server sees this as an error and gives me a 426.

In active mode, you signify the end of the data stream by closing the port.
I am doing the same in passive mode and this is failing.

Martin.

"Bryan Martin" <sp**@ahwayside.com> wrote in message
news:e7**************@tk2msftngp13.phx.gbl...
PASSIVE (PASV)
This command requests the server-DTP to "listen" on a data
port (which is not its default data port) and to wait for a
connection rather than initiate one upon receipt of a
transfer command. The response to this command includes the
host and port address this server is listening on.
"Martin Robins" <martin - robins @ ntlworld dot com> wrote in message
news:eg****************@TK2MSFTNGP12.phx.gbl...
I know this is not really the right forum for this topic, but I figured
there are a lot of people here who may be able to provide me with an

answer
to my question so I would give it a try.

About a year ago I wrote an FTP client in C#. It supported only 'Active'
mode as that was my requirement at the time; however I now need to support 'Passive' mode.

From what I can see, this simply means that you ask the server for the
details of the port to which the data connection should be made by using

the
PASV command and then open an outbound connection to the server on the

port
specified to transfer data across. Nothing else changes.

I have done this, and to a certain extent it works. I issue the PASV
command, open a connection to the port specified by the server and send

the
data. I then close the connection. At this point, I get a 426 error,
Connection Closed, transfer aborted.

I figure I am missing something but cannot fathom what it is. Should I be sending any additional messages to the server to indicate that the

transfer
is complete?

Any help will be gratefully accepted.

Thanks.


Jul 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Cobra Pilot | last post by:
I inherited a SQL 2000 Enterprise active/passive cluster under AS. Both nodes run on identical HP DL580's with 4 Xeon processors and 8GB memory. The former dba attempted to setup AWE memory but...
1
by: Oliver Hoehle | last post by:
Hello! This ist the source-code for an editable combobox implemented with HTML,CSS and Javascript. I have tested it with IE and Mozilla. But I don't know, if it will work in other browsers...
2
by: Martin Robins | last post by:
I know this is not really the right forum for this topic, but I figured there are a lot of people here who may be able to provide me with an answer to my question so I would give it a try. About...
0
by: KS | last post by:
Do you have some sample code that interfaces these units ? Regards KS, Denmark
1
by: gregory_may | last post by:
I want to bind multiple UDPClients to the same port on the same machine. I want them to all listen for broadcast messages & respond accordingly. Multiple client bindings "under normal...
4
ADezii
by: ADezii | last post by:
Passive Shutdown is a little known, Jet 4 enabled feature that allows you to prevent Users from connecting to a Database. It is also known as Connection Control. This feature is referred to as...
0
by: przemek | last post by:
Writing a simple checkers game I can't decide: - to implement a pawn as a windows control communicating with the future game engine and paint a passive "wallpaper" board, - to make a board of 64...
19
by: Prisoner at War | last post by:
Okay, Folks, I guess my real burning concern all along is a "high-level" one: just how does JavaScript interact with CSS? Right now, my newbie self only knows JavaScript and CSS to *co-...
1
by: PeteCresswell | last post by:
I posted this on microsoft.public.access - then realized that this was a more appropriate group. -------------------------------------------------------- Muni bonds. Accounts within...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.