To upload file to a specific folder, your server API must support that.
Server side for receiving uploaded files, you can use http://commons.apache.org/fileupload/
Client side for sending a file upload request, you can use https://hc.apache.org/httpcomponents-client-ga/index.html