The URL to request the file from.
Optionalfilename: stringThe filename to save the file as. If not provided, it tries to use the filename from the content-disposition header or defaults to "missing_filename".
OptionalonError: (e: Event, status: number, responseText?: string) => voidCallback function to handle errors during the request. The third parameter contains the response text if available.
OptionalonLoaded: () => voidCallback function to handle successful download completion.
Downloads a file from the given URL and saves it with the specified filename.