auto detect file type or preset it