web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics NAV (Archived)

"Error: (530) Not Logged in" when uploading a file from NAV 2018 to a FTP Site

(0) ShareShare
ReportReport
Posted on by

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)
  • Verified answer
    KTA Profile Picture
    1,200 on at

    Are you sure that you working with the right type of FTP? A simple FTP that's the type your working it's quite strange these days.

    More info: titanftp.com/.../whats-the-difference-ftp-sftp-and-ftp-s

  • Community Member Profile Picture
    on at

    Thank you for the tip.

    I have checked with the partner I need to exchange the files with. The partner is the host of the FTP site. The partner confirmed they are running FTP for the site I'm trying to connect to. They try to keep it simple for multiple client connections. The partner also supports SFTP.

    While I appreciate the limitations of FTP as your link indicated, my immediate need is to overcome the error I'm encountering. Then we can switch to SFTP for enhanced security (now that my partner supports it as well).

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics NAV (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans