550 ftp 期间文件名无效错误
当我尝试将文件复制到 ftp 服务器时,收到 550 文件名无效错误。它正在连接并登录。
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());
谁能告诉我哪里出了问题?
谢谢,
我认为这只是文件权限的情况。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您正在发送完全限定名称 - 我怀疑您只是将相对文件名发送到 FTP 服务器。
You're sending the fully-qualified name - I suspect you're only meant to send relative filenames to the FTP server.