我正在尝试将一些文件上传到我被授予完全控制权的共享文件夹中,但我发现由于某些身份验证原因,连接无法正常工作。这是我用于一些编写测试的代码:
String destination = "serverX/shareFolder/";
String domain = "myDomain";
String smbFile = "smb://"+domain+"/user1:pwd1@"+destination;
SmbFile sFile = new SmbFile(smbFile);
SmbFileOutputStream sfos = new SmbFileOutputStream(sFile);
sfos.write("Test".getBytes());
sfos.close();
这是我收到的错误:
jcifs.smb.SmbAuthException: The referenced account is currently locked out and may not be logged on to.
最佳答案
看起来代码很好,问题似乎出在您使用的帐户上。您尝试过其他帐户吗?或者您可以在服务器上以某种方式“解锁”帐户。
关于Java文件上传到Windows共享文件夹并进行身份验证,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55859274/