rv1822
rv1822

Reputation: 169

550 Filename invalid error during ftp

I'm getting a 550 Filename invalid error when I try to copy a file to an ftp server. It is getting connected and logged in.

ftp.connect(server);
ftp.login(user, password);

String filename = "testing.txt";
fis = new FileInputStream(filename);
File file = new File(filename);
FileInputStream fis = new FileInputStream(file);
String cwd =client.printWorkingDirectory();

boolean check = ftp.storeFile("C:\\test\\"+filename, fis);
if(!check)System.out.println(ftp.getReplyString());

Can anyone tell me where I'm going wrong?

Thanks

I think its just a case of file permissions.

Upvotes: 1

Views: 7189

Answers (1)

Jon Skeet
Jon Skeet

Reputation: 1500923

You're sending the fully-qualified name - I suspect you're only meant to send relative filenames to the FTP server.

Upvotes: 2

Related Questions