550 Filename invalid error during ftp

我怕爱的太早我们不能终老 提交于 2019-12-11 09:06:16

问题


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.


回答1:


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



来源:https://stackoverflow.com/questions/9273736/550-filename-invalid-error-during-ftp

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!