How to upload files to VPS using Java - java

So I have a VPS and would like to know how I can upload a file (images in particular) to the VPS using Java. What do I need to install on the VPS and how would I go about doing this?
My VPS is going to be CentOS.

You might want to use the Apache Commons Net library to connect to your VPS using FTP. You will need to install FTP on your VPS. How you will go about installing FTP depends on what OS your VPS is running.

Related

Access FTP files from java without filezilla or winscp

I have made java web application for uploading file in ftp and in the same application user can directly open files in browser. It is running successfully when Filezilla or winscp is opened. After closing filezilla and winscp I can't access or upload files to ftp. Is there any possible solution, that I can access these files from web application without installing external application. I'm using Apache commons.net library for ftp connection.
There is JSch that is a library to access sftp in Java. I have used it before in a project and is relatively straight forward. Probably you will have to work on it to open files in a web application though.
http://www.jcraft.com/jsch/examples/Sftp.java.html

Get file form windows server to linux server

I am trying to run a servlet on the Linux server which connects to the windows server and gets the files present on it.
Is there any library to get files from windows as we have just in Linux and Unix.
As I know that using javascript only FTP is not possible.
Please let me know if you have some info to share.
Thanks in advance
Share your file on windows.
use jcifs library to access that. http://jcifs.samba.org/
refer to access to file using Java with Samba JCIFS
for example.

Question about Tomcat for Java Server Based on sockets

I would like to know if I purchase a VPS service(linux based) over the net.
Do I need Tomcat to be installed in order to launch my java based server (socket server)?
If yes Which version do I need, and can you please give me a reference for an online guide for how to install and run things on a VPS which is based on Linux.
Thanks
If your are not deploying web apps (WAR's), you don't need a application server like tomcat or glassfish. So to run your java based server, you only need the JRE.
Get a Windows-based VPS if you are not familiar with Linux, as you have to administrate the server (apply patches, etc.), if it is not managed by your provider.
Have a look at this Superuser question for Linux books.

installed a jetty server. Do I need other configurations for it to run php/java code?

I have previously installed xampp on my remote linux server. So I already have php pre-compiled. Java also. I installed a jetty server. Do I need other configuration to it to run both PHP and JSP?
I want to use JSP and jetty server instead of PHP and apache for scaling issues regarding a notification system that I will soon apply. Any feedback on this descision will be apprecitied
See their documentation for PHP support.

download remote machine files using java

I would like to download somefiles which is in remote shared folder from the local system using java code. Can you please guide us, how i can proceed this. Whether i need use http or ftp. But i want to execute the code only in the local machine. It should not like client server program. Please post some tips over here.
Thanks in advance.
You cannot solve this without knowing the platform of your machine (where the app runs) and remote machine. But once you know you have many possibilities.
Agent full solution
Install agent on remote machine. The agent should expose API that allows access to the files. For example you can use FTP server as an agent. Then access this server and download your files. Alternatively you can implement your own application or servlet running in one of available servlet containers and provide access to files over HTTP.
Agent-less solution
Use the built-in functionality of target machine. For example use SSH to connect to Unix machine and SMB for windows. Both support Telnet
You can use VFS package from jakarta. There are several implementations of SSH. I recommend JSH.

Categories