amethystct
Programmer
Hi,
I have a program that ftp's a file from a server that is outside our firewall. I'm told I have to send the "pasv" command in order to let the data connection bring the file back. I can see in the debugging that it's setting the connection as passive but it sets it back to active when I get the file. I'm getting a new socket connection which is passing zero. This is wrong. I want to pass the port that would have been passed to me by the server (?). How do I set the socketconnection to that port? If I get the response from the passive command I get:
227 Entering Passive Mode (198,62,245,39,170,44)
The port I should use is 17044 ? Will it always be the last 5 digits? Isn't there a way to just get the port w/out having to strip out and rebuild it?
I have a program that ftp's a file from a server that is outside our firewall. I'm told I have to send the "pasv" command in order to let the data connection bring the file back. I can see in the debugging that it's setting the connection as passive but it sets it back to active when I get the file. I'm getting a new socket connection which is passing zero. This is wrong. I want to pass the port that would have been passed to me by the server (?). How do I set the socketconnection to that port? If I get the response from the passive command I get:
227 Entering Passive Mode (198,62,245,39,170,44)
The port I should use is 17044 ? Will it always be the last 5 digits? Isn't there a way to just get the port w/out having to strip out and rebuild it?