I am uploading a file to server using normal upload APIs available. Now I want to check whether uploaded file is valid file.
I can have multiple file upload box on page. Which have different requirements and should accept different type of files.
For say:
Input file 1 should take just exe
Input file 2 should take just html
Input file 3 should take just pptx
I can check extension and check is one solution but it may happen some one may fake the extension and upload txt
file instead of exe
and so
So how can I check whether correct type of file has been uploaded or not using Java
Got some solution for the same stuff but am unsure how to do it.