You should implement a servlet to do this, rather than a JSP. Assuming the POSTs received are multipart/form-data, you should use a library to parse out the file data. I recommend Apache Commons FileUpload (http://jakarta.apache.org/commons/fileupload/
). When you receive a request, pass it to FileUpload for parsing, then get an InputStream for the file data. Read from the InputStream and write to a FileOutputStream on the hard drive.