Altered functions to allow mimeType hinting and to allow disabling of excessive sanitizeFilePath() use.