You can refer to http://cit3.cdn.swin.edu.au/utilities/upload/File_Upload_Using_Java.html It may help you.
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)