For a project I need a file transfer for the first time and have to connect to an intranet Microsoft IIS FTP server.
I can connect anonymously and do not need any special requirements. With a file manager such as Total Commander or Double Commander, I can easily connect as an anonymous user and upload files.
With PB FTP I can connect and (presumably) select the target directory. But SendFTPFile() simply fails.
So I wonder if I should invest more time in this or if there are already known limitations in the FTP implementation?
Fortunately I found PB.Ex_FTP. It worked right away. But I would like to avoid external dependencies.
What do you think?
This is my code:
Code: Select all
Procedure FTP_Transfer()
Protected Result
If OpenFTP(0, "192.168.150.126", "anonymous", "anonymous@anonymous.org", #False, 21)
If SetFTPDirectory(0, "ps")
Debug "Directory set to /ps"
EndIf
Debug IsFTP(0)
Result = SendFTPFile(0, OpenFileRequester("Choose a file to send", "", "*.*", 0), "purebasic_sent.pb")
Debug "Result: " + Str(Result)
EndIf
EndProcedure
FTP_Transfer()
MessageRequester( "FTP done", "")
End