After uploading a file it gets stored as a .tmp file in a temp directory.
How can one get the actual file type of the file that was uploaded? I need to know if it’s a bmp, jpeg, png, etc. from server side.
Note: I’m also using Struts 2 version 2.1.8.1
On JSP if you have
in your ActionClass you need to add
and then you would have access to the fileName and contentType of uploaded file