In apache commons file uploading the uploaded files are available as FileItem objects.
If I get the name of such file item by using fileitem.getName() it returns the full path (ex: C:\Test\test.txt).
Is there any way to get only the file name.
What I actually need is to save the uploaded file as temp file using File.createTempFile()
but the name and extension of the temp file should be the same as the uploaded file rather than a random name(like temp.tmp)
Try what the docs say