Skip to main content
Download a file and save it locally.

Parameters

PropertyTypeRequiredDescription
urlStringYesFile URL to download
headerObjectNoRequest headers
successFunctionNoCallback on success
failFunctionNoCallback on failure
completeFunctionNoCallback that always executes

Success Callback

PropertyTypeDescription
apFilePathStringLocal temporary file path

Code Example

my.downloadFile({
  url: 'https://example.com/file.pdf',
  success: (res) => {
    console.log('Downloaded to:', res.apFilePath);
  }
});