Function getDataFromFile

  • Fetchs a URL and returns the response body as a base64 string.

    Parameters

    • ctx: Context
    • fileUrl: string

      The url from which to fetch the file.

    • headers: Header = {}

      Headers are key value pairs spread to override headers sent in request.

    Returns Promise<Base64Data>

    The file as a Base64 string.

    Example

    const file = await getDataFromFile('https://example.com/file.zip');
    

    Example

    const file = await getDataFromFile('https://example.com/file.zip', {
    authorization: 'Bearer AbCdEf123456',
    });
    const contents = await downloadFile(file);

Generated using TypeDoc