Skip to main content

Function: downloadFile()

function downloadFile(
context,
siteUrl,
url,
destDir
): Promise<DownloadedFile>;

Defined in: core/files.ts:51

Saves a file of the site into destDir with the person's session, never overwriting. Only URLs of the site's origin: the session's cookies go nowhere else (its media outside Moodle's path included).

Parameters​

ParameterType
contextBrowserContext
siteUrlstring
urlstring
destDirstring

Returns​

Promise<DownloadedFile>