I have an upload program which uploads file and saves it to the specified host on which this application is deployed.
I want to save this files to other host.
Can someone guide me what changes I must do to my dispatcher servlet for the same or any other alternate?
I Would advice to open a new connection with the other host within the Servlet and upload the file using the connection.
If you want to use BufferredReader/Writer from efficiency perspective, you may want to write as below: