简体   繁体   中英

Java uploading file to AWS EC2 server

our use case needs to upload file from our on-premise server to an AWS EC2. Tried doing some research and could not find any available code samples on how to do this in Java. Has anyone done this before? and if yes and you direct me to some code template or sample codes I can use as basis.

We are using Java 8 by the way. Our EC2's VPC is connected to our on-premise network so for sure our on-premise server can see it.

If you don't have any specific services installed on your EC2 instance and want to push files to EC2 (instead of pulling from other services like S3), you could transfer files using the SSH protocol.

You can use jsch which is a Java library that implements SSH. There are many examples on the jsch website showing how to use jsch, also specific ones showing file transfers.

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