Here my requirement is to upload the file and to store it in the disk. I have no problem in storing it in disk, but getting the extension of the file. The problem is when I clic
This worked for me
Part filePart = request.getPart("input-file"); String type=filePart.getContentType(); type="."+type.substring(type.lastIndexOf("/")+1);