Get file format from file name during export

If a valid file format is included in the file name, use it and don't prompt the user for the format.

If the file format is not valid, the export process ends, and no file is created.