Class: FileDownloader

Utils.FileDownloader(url, parameters)

Class representing a file downloader. Can be used to override the format file name.

Constructor

new FileDownloader(url, parameters)

FileDownloader construtor

Parameters:
Name Type Description
url string

A string or any other object with a stringifier — including a URL object — that provides the URL of the resource to send the request to.

parameters object

Parameters that will be serialize as a Query string

Source:

Members

parameters :object

The parameters

Type:
  • object
Source:

url :string

The url

Type:
  • string
Source:

urlParameters :URLSearchParams

The parameters as URLSearchParams

Type:
  • URLSearchParams
Source:
See:

Methods

(async) fetch() → {Promise.<Response>}

fetch file and download it

Source:
Returns:

the response downloaded

Type
Promise.<Response>

formatFileName(filename) → {string}

Format a file name to be used as a download file name / can be replaced by a child class

Parameters:
Name Type Description
filename string

the file name to format

Source:
Returns:

the file name formated

Type
string