Add file.headers check to getFileInfo.type

This small change allows support for multiparty - Otherwise the file type check fails at line 843 as file.headers['content-type'] has been removed at that point.