Some of you have troubles getting JSP upload functions in your code working. Here is upload code example that you can drop in to a JSP file in your webapp directory to quickly check if uploading works. Common cause of problems is lack of write privileges in a directory where you are trying to upload to. It will upload to your current web app directory defined in filePath variable. The code uses commons-fileupload-1.2.2.jar and commons-io-2.4.jar in WEB-INF/lib to make it simple. Uploading code without these fileupload classes is bigger and not so easy readable. Here is the content of uploadtest.jsp.