add mimetype checking to rule out unsupported file type