Zip Component, Email Component, Encryption Component ActiveX Control for Zip Compression .NET Components for ASP.NET
ActiveX and .NET Components for Zip Compression, Encryption, Email, XML, S/MIME, HTML Email, Character Encoding, Digital Certificates, FTP, and more ASP Email ActiveX Component


Index of Chilkat Blog Posts

November 13, 2007

504 Invalid PORT address

Question:

I get this error when trying to do an FTP upload using TLS/SSL:

ChilkatLog:
  PutFile:
    LocalFilename: d:\work\TEST FILE.txt
    RemoteFilename: TEST FILE.txt
    DllDate: Nov 12 2007
    Username: my_username
    Component: .NET 2.0
    Active transfer mode
    MyIP: 192,168,1,50,18,15
    PortReply: 504 Invalid PORT address
    Failed to setup active data socket.
    Try using passive mode instead.
    Failed.

Answer:

The "504 Invalid PORT Address" is because your NAT Router (Network Address Translating Router) was not able to modify the IP address (192.168.1.50) from an internal IP to an external one because the control channel is SSL. Therefore, try calling ClearControlChannel immediately after connecting. If your FTP server supports it, your control channel will be unencrypted, but the data transmissions will remain encrypted. This allows your router to translate the IP from internal IPs to external IPs.

Keep the Passive property = false.

Make sure to check the return value of ClearControlChannel to ensure that it succeeded.


Privacy Statement. Copyright 2000-2011 Chilkat Software, Inc. All rights reserved.
Send feedback to support@chilkatsoft.com

Components for Microsoft Windows XP, 2000, 2003 Server, Vista, Windows 7, and Windows 95/98/NT4.