2

I'm trying to work with provided CSV files on an FTP. I can log onto the FTP Server and when I:

ftp = FTP(server);
ftp.login(user = 'user', passwd = '***');
print(ftp.dir());

it works fine. But I can't change the directory by ftp.cwd('/CSV') It comes up with a permission error. Even though I'm already logged in. What's the problem?

I've even tried:

ftp = FTP(server);
ftp.login(user = 'user', passwd = '***');
ftp.cwd('/CSV');
ftp.login(user = 'user', passwd = '***');

Is it possible to create a server connection with the path directly, like so: server = server/CSV/Folder?

Thanks in advance!

Martin Prikryl
  • 188,800
  • 56
  • 490
  • 992
Kai Stredder
  • 35
  • 1
  • 3

1 Answers1

1

Try it without the leading slash:

ftp.cwd('CSV');

It's possible that your account is not chrooted, so the desired path is like /user/home/CSV, not /CSV. Or your FTP server does not support absolute paths with CWD command.

Martin Prikryl
  • 188,800
  • 56
  • 490
  • 992