Retrieves the file type from the file name. Official Docs Can we pass the URL instead of a filename as the first parameter? Yes.