简体   繁体   English

Java文件通过身份验证上传到Windows共享文件夹

[英]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.

相关问题 使用java连接到Windows中的共享文件夹 - connecting to shared folder in windows with java Java无法从Linux在Windows共享文件夹中创建文件 - Java Not able to create a file in windows shared folder from Linux java 如何使用服务帐户在共享驱动器中创建文件夹以进行身份验证 - java how to create folder into shared drive using service account for authentication 通过身份验证从共享文件夹中读取文件数据(FileNotFound异常) - Reading file data from shared folder with authentication (FileNotFound Exception) Java Servlet将文件上传到“网页”文件夹 - Java servlet upload file to “Web Pages” folder Java共享属性文件:Windows + Unix(通用) - Java shared Property File: Windows + Unix (generic) 在Linux上运行的Java代码中,如何指向共享的Windows文件夹? - In Java code running on Linux, how to point to a shared Windows folder? 从身份验证为Java.io.File的共享路径读取文件 - Read file from shared path with Authentication as Java.io.File Delphi XE5-Android-将文件保存在服务器窗口(共享文件夹)中 - Delphi XE5 - Android - Save file in server windows (shared folder) 如何使用Java将Windows中的文件夹上传到Linux计算机 - how to upload a Folder from Windows to Linux machine using Java
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM