[英]Java file upload to windows shared folder with authentication
我正在嘗試上傳一些共享文件夾上的文件,我完全控制了該文件夾,但我發現由於某些身份驗證原因,該連接無法正常工作。 這是我用於編寫測試的一段代碼:
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.
看起來代碼是好的,問題似乎是您正在使用的帳戶。 你試過其他帳戶嗎? 或者也許你可以在服務器上“解鎖”帳戶。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.