Hey guys . When trying to upload/donwload from FTp test server to nav and using WinSCP i get an error of type ,cant load WinSCP instances.Any suggestions ?
Hey guys . When trying to upload/donwload from FTp test server to nav and using WinSCP i get an error of type ,cant load WinSCP instances.Any suggestions ?
Hey there can I have the text or fob file as well please. Thank you, Geovanny
Hello
Make sure you have the right version. Or re-select the variables in your designer. WinSCP releases updates so the version installed on your computer will be different than the one running on your client.
Ok , but how can i ask you about some things i dont understand there , if possible ?!
Sorry, I don't have the fob, I have the text file if you need it.
Hey Suresh , can i have the fob of your previuous example ?
Yes but it was given the way they need it to be done ,thats why i need to use WinSCP. I am sharing you the code but i dont think teres problem in the code because wheni try to save codeunit it says canot load WinSCP....... the specific .Net variable.
Heres the code :
LEAR(WinSCPSessionOptions);
CLEAR(WinSCPSesh);
CLEAR(TransferOptions);
WinSCPSessionOptions := WinSCPSessionOptions.SessionOptions;
WinSCPSessionOptions.HostName := 'INDIRIZZO IP';
WinSCPSessionOptions.UserName := 'USERNAME';
WinSCPSessionOptions.Password := 'PASSWORD';
WinSCPSessionOptions.PortNumber :=21;
DirectorySFTP := '/DIRECTORYFTP/';
Protocol := Protocol.Ftp;
WinSCPSessionOptions.Protocol(Protocol);
FtpSecure := FtpSecure.Explicit;
WinSCPSessionOptions.FtpSecure(FtpSecure);
WinSCPSessionOptions.GiveUpSecurityAndAcceptAnyTlsHostCertificate(TRUE); // acquisisce e valida in automatico l'impronta digitale (certificato) del server
WinSCPSesh := WinSCPSesh.Session;
WinSCPSesh.Open(WinSCPSessionOptions);
IF WinSCPSesh.Opened THEN BEGIN
TransferOptions := TransferOptions.TransferOptions;
TransferOptions.TransferMode := TrasferMode.Binary;
TransferOperationResult := WinSCPSesh.PutFiles('FILE DA INVIARE',DirectorySFTP,FALSE,TransferOptions);
IF TransferOperationResult.IsSuccess THEN
MESSAGE('Upload completato')
ELSE BEGIN
SessionRemoteExceptionCollection := TransferOperationResult.Failures;
FOREACH SessionRemoteException IN SessionRemoteExceptionCollection DO
MESSAGE(SessionRemoteException.ToString);
END;
END ELSE
MESSAGE(GETLASTERRORTEXT);
Share your code. You don't need to use the WinSCP to upload/download you can connect directly to the server without additional software. I believe I have already shared code with you in other thread.
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 290,532 Super User 2024 Season 2
Martin Dráb 228,501 Most Valuable Professional
nmaenpaa 101,148