When the PutFile
method finishes, it has already transferred the file and read all outstanding responses. There is no further response to be read at that point and therefore the ReadResponse
method fails.
To capture responses processed by the PutFile
method, use Ftp
object's ReadResponse
event (add a custom event handler before the PutFile
method is called and remove it afterwards).