Change to use file mimetype not OBJ mimetype incase it's called when the OBJ isn't set or isn't updated.