I have being playing with the DownloadableResource, and have two issues, on Android
The first is that some times the files aren’t being downloaded correctly, some pdf for example are downloaded incorrectly or damaged, some I don’t have problem, I can opened on the PDF Reader but with other files I got the message ‘Error, your document cant open because is damaged’, how ever if I download the same file in my computer or iphone or other app the files works, this is happening with pdfs, images, and other docs, my guess is that I need to configure some timeout, or maybe is the doc size or something? However on the onDownloadFinished(error) shows “No error”
onDownloadFinished: {
switch(error){
case DownloadableResource.NetworkError:
console.debug("DownloadableResource: Network error");
break;
case DownloadableResource.UnauthorizedError:
console.debug("DownloadableResource: Unauthorized Error");
break;
case DownloadableResource.FilePathError:
console.debug("DownloadableResource: file path Error");
break;
case DownloadableResource.FileExtractionError:
console.debug("DownloadableResource: File Extraction Error");
break;
case DownloadableResource.DownloadCancelledError:
console.debug("DownloadableResource: Downloa dCancelled Error");
break;
case DownloadableResource.UnknownError :
console.debug("DownloadableResource: UnknownError");
break;
case DownloadableResource.NoError:
default:
console.debug("DownloadableResource: No error")
break;
}
My second issue is, how can I remove the ‘_package’ subfolder of the download path, I want to save the files on the ‘Downloads’ folder, is there a way to set the external media download folder? (I mean the SD card). It was very difficult to find where the documents were being saved, since the android have at least 2 downloads folders. I have already tried setting a default path on the property ‘DownloadableResource.storagePath’ but it is being ignored and set to a default storageLocation path