Tries to determine the file type of a file from its URL This method does perform a range request to the server to get the first few bytes of the file If the file type can not be determined it will return "unknown"
The URL of the file
const url = "https://example.com/model.glb";const fileType = await tryDetermineFileTypeFromURL(url);console.log(fileType); Copy
const url = "https://example.com/model.glb";const fileType = await tryDetermineFileTypeFromURL(url);console.log(fileType);
Tries to determine the file type of a file from its URL
This method does perform a range request to the server to get the first few bytes of the file
If the file type can not be determined it will return "unknown"