Add MIME type detection when uploading material files