SMARTftp has built-in procedure calls that easily handle file exchange commands between Business Central and FTP servers.
Codeunit: 71583700 "SMART FTP"
procedure GetList(protocol: text; host: Text; ReturnEncryptionMethod: Text; ReturnSLLProtocol: Text; username: text; password: text; port: Integer; path: text): Text
WSResponse.Content().ReadAs(body);
exit(body);
procedure Delete(protocol: text; host: Text; ReturnEncryptionMethod: Text; ReturnSLLProtocol: Text; username: text; password: text; port: Integer; path: text; filename: text): Text
WSResponse.Content().ReadAs(body);
exit(body);
procedure Upload(protocol: text; host: Text; ReturnEncryptionMethod: Text; ReturnSLLProtocol: Text; username: text; password: text; port: Integer; path: text; filename: text; base64document: text): Text
WSResponse.Content().ReadAs(body);
exit(body);
procedure GetAsBase64(protocol: text; host: Text; username: text; password: text; port: Integer; path: text; filename: text; ReturnEncryptionMethod: text; ReturnSLLProtocol: text): Text
WSResponse.Content().ReadAs(body);
exit(body);
Note
You will need to convert your document to base 64, saved in a text variable, before calling the procedures