gave up on detecting mime type of uploaded file on the server side, there is just no reliable way to do it