The last hurdle to take to get this working at the clients location wast to remove the check on mime type. Checking the mime type doesn't seem to be a solid check at all since it can be altered at the client side. In fact it was blocking the function now because I expected txt/csv, but Windows uploaded it with ms-excel mime type.