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

Popular posts from this blog

curl - PHP fsockopen help required -

HTTP/1.0 407 Proxy Authentication Required PHP -

c# - Resource not found error -