|
When issuing raw commands against the a FileZilla server to upload a file, I receive either a "550 Filename invalid" or a "425 Can't open data connection.". There is nothing in the rebex log file that helps. The reason why I'm using raw commands against the server is because I need to connect to a different FTPS server that requires the "PUT" raw command when uploading files. Using the Rebex PutFile method the FTPS server rejects the upload because the "STOR" command is being sent. Here is the code when connecting to the FileZilla server:
|
|
The SendCommand method is not a command-line-like interface to Rebex API. All it does is sending the supplied commands to the server as-is, without any further processing. This is fine for simple commands, but won't work for commands that need other actions to be done at the client. In case of STOR command, the client has to connect to the IP/port returned by the server in response to the PASV command. The PutFile method does that, but SendCommand alone does not - that's why the log doesn't contain anything useful except the 425 error response. To make the code work, you would have to handle the data transfer yourself. This is not recommended, but it can be done:
By the way, please let us know which FTP server requires a This is awesome! That's what I thought too - command-line FTP clients using PUT but sending STOR to the server. There was an instance when we had to connect via FTP over IPsec using the windows command line because clients' IT department informed us we needed to issue a PUT command due to the STOR command not being supported by their server. It was strange to see the FTP windows command line being able to successfully transfer files even though it was sending a STOR during the process while the FTP Rebex component wasn't. This client was using an EDTUP Unix system. In this case, the client is using an IBM z/os Unix system. A small update to the code above. Before upgrading the connection to SSL, the TlsSocket parameters need to be set.
(08 Sep '11, 21:28)
ktabarez
1
Interesting! Yes, I forgot the Parameters (they were not needed with our test server) and re-using the control connection ones is a good idea. One more tip: if you remember
(09 Sep '11, 07:31)
Lukas Pokorny ♦♦
|
|
Here is the .NET VB version of the code above
|