简体   繁体   中英

How can i upload file in remote machine(LAN) using java

我该如何使用Java程序在远程计算机(LAN)中上传文件。我想在LAN中连接远程计算机并将文件从本地计算机上传至远程计算机。所以请告诉我该怎么做。

I suggest you use JSch . You'll be able to connect easily to a remote machine and it allows you to execute file transfer using sftp for example .

It's hard to find a real documentation for JSch, but the various examples they give on their site are really complete and in general sufficient to help one succeeding in his task.

You probably want an HTTP client library for Java, to issue an HTTP POST request. (I assume the remote machine has some web server to upload the file).

Google gives several suggestions, like Hc.Apache

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM