Fix potential error in the Upload field with detecting the mimetype