- I am having some trouble when using downloadUrl from CoreFilepoolProvider, I want to download the file to another filePath(that already exist)
Here is my sample code:
var promiseresult = that.CoreFilepoolProvider.downloadUrl(siteId, url, true, 'mod_sample', componentId, 0, ''", filepath);
which filepath is the filepath(already exist) that i get from the function getFilePathByUrl and remove the extension of the file.
Sample string look like this : sites/1768337554dd35813e7bc0a3eabbc852/filepool/sample_62f104b1a783358d9cad1d2f63f447ff
I keep getting this error:
Error downloading sample.htm?token=c92dc8a3de23b6378e6fdcd44dc40f1b&offline=1 to sites/1768337554dd35813e7bc0a3eabbc852/filepool/sample_62f104b1a783358d9cad1d2f63f447ff Error
Could anyone please help me how to use the downloadUrl with param filePath correctly,I can't find any sample or documentation about it.
I am using Moodle Desktop to debugging.