I have a jsp
with this code snippet in it.
use MultipartFile utility and try this
MultipartRequest multipartRequest = (MultipartRequest) request;
Map map = multipartRequest.getFileMap();
MultipartFile mfile = null;
for (Iterator iter = map.values().iterator(); iter.hasNext();) {
mfile = (MultipartFile) iter.next();
String fileName = mfile.getOriginalFilename()
}
Or you can try apache commons file upload.
Check this link : http://commons.apache.org/fileupload/using.html