Detect mime-type at save-step for better performance