Hello,
I have used the following code as was posted for NAV 2016:
UploadFile(FileNameToUpload : Text;UploadToFtp : Text;Login : Text;Password : Text)
FTPRequest := FTPRequest.Create(UploadToFtp);
Credentials := Credentials.NetworkCredential(Login,Password);
FTPRequest.Credentials := Credentials;
FTPRequest.KeepAlive := TRUE;
FTPRequest.UsePassive := TRUE;
FTPRequest.UseBinary := TRUE;
FTPRequest.Method := 'STOR';
RealFileStream := FileStream.OpenRead(FileNameToUpload);
SimpleStream := FTPRequest.GetRequestStream;
RealFileStream.CopyTo(SimpleStream);
SimpleStream.Close;
RealFileStream.Close;
The code fails on line "SimpleStream := FTPRequest.GetRequestStream;" with the error message:
"A call to System.Net.FtpWebRequest.GetRequestStream failed with this message: The remote server returned an error: (530) Not logged in"
I have verified the login and password. I can login to the ftp site using Windows File Explorer using the same login and password. I have tried affixing the ftp domain to the user name as suggested in some online posts but the error persists.
Ps assist.
*This post is locked for comments
I have the same question (0)