I have a web page that allows users to upload a file. It is running inside of a J2EE web server (Websphere Application Server). Our company has bought a Total License. We are wanting to use Aspose to make sure that the files do not have any malware. I am trying to get the file format and extension using the detectFileFormat method of the FileFormatUtil class.
javax.servlet.http.Part file; //+getter and setter
FileFormatInfo formatInfo = FileFormatUtil.detectFileFormat(file.getInputStream());
I am selecting a word document (.docx) to upload. The method always returns 255 which I believe is an unknown document type. I have also tried a text document (.txt) which also returns 255, unknown document type.
We need to be able to verify that the document is safe before we allow the file to be uploaded.
Thanks in advance.