ftplib.error_perm: 550 when trying to change directory

Viewed 2849

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!

1 Answers

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.

Related