You need to send using JavaScript, that is, not Java, namely JavaScript from the browser image to the server? Yes it is elementary simply, and here Java? It's possible that this is an error, but if you need to remove the photo from Java on the server even easier, since the java program can work with local files automatically, and in the browser you need to choose the file for sending yourself, because these are security requirements.