Java Inspect File Contents -
i have jee6 app accepts files via post. can perform server side basic test ensure file extension correct there way inspect file contents make sure don't process unless i'm happy valid file i.e. avoid renaming file extension
if know mime type of file, can try comparing value returned files.probecontenttype(tempfile)
(documentation here).
mime types can have number of optional parameters (for example "text/plain; charset=utf-8"), may want compare using mimetype.match method rather comparing strings.
Comments
Post a Comment