Download can be performed in a similar way. Basically you just need to point InputStreamto the server side, which you then write to whatever OutputStreamyou want, for example. FileOutputStreamto save it to the local file system on disk. The download is also basically the same, you only need to change the title Content-Typeaccordingly to present the correct type of content so that the browser knows what to do with it.
Servlet file upload processing can be easily done using Apache Commons FileUpload . Here is a basic example . Downloading can be done easily with the help of a servlet that receives the file InputStreamand writes it to the OutputStreamresponse in the usual way of Java IO. Here is a basic example .