[英]Java file upload to windows shared folder with authentication
I'm trying to upload some files on a shared folder where I'm granted on with full control, but I see that connection is not working for some authentication reasons. 我正在尝试上传一些共享文件夹上的文件,我完全控制了该文件夹,但我发现由于某些身份验证原因,该连接无法正常工作。 This is the piece of code I've used for some writing tests: 这是我用于编写测试的一段代码:
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();
this is the error I've received: 这是我收到的错误:
jcifs.smb.SmbAuthException: The referenced account is currently locked out and may not be logged on to.
Is looks like the code is good, the problem seems to be the account you are using. 看起来代码是好的,问题似乎是您正在使用的帐户。 Have you tried other account? 你试过其他帐户吗? or maybe you can "unlock" the account someway at the server. 或者也许你可以在服务器上“解锁”帐户。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.