The URL to request the file from.
Optional
filename: 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".
Optional
onError: (e: Event, status: number, responseText?: string) => voidCallback function to handle errors during the request. The third parameter contains the response text if available.
Optional
onLoaded: () => voidCallback function to handle successful download completion.
Downloads a file from the given URL and saves it with the specified filename.