I would like to suggest that the extension be fundamentally redesigned so that it is not necessary to download complete files.
It is not ideal to download the complete files. Some files are several gigabyte large. For other resources, a lot of computing time is required in the source system.
Therefore, I suggest different levels to determine the file format:
Trust the format specification made by the user.
Do a HTTP HEAD request and trust the webserver's answer.
Download a few bytes of the resource and use file magic numbers.
I would like to suggest that the extension be fundamentally redesigned so that it is not necessary to download complete files.
It is not ideal to download the complete files. Some files are several gigabyte large. For other resources, a lot of computing time is required in the source system.
Therefore, I suggest different levels to determine the file format: