I've got a fairly simple file transfer going that should download a file from AWS and is supposed to store it to the device. While this appears to work for JPEG files, it fails on PDFs and PNGs with an error that simply says Could not create target file
.
A bunch of other files are being created at the same time, but the same 2 files always fail. I am watching it fail on the iOS emulator.
Is there some limit to the number of files I should be downloading at once? Is there something special about PDF and PNG files?
Edit:
The code is literally just:
$cordovaFileTransfer.download(fileUrl, cordova.file.dataDirectory + "attachments/myFile.pdf" +, {}, true)
.then(() => {
return "yay";
}, (error) => {
console.log("error downloading attachment:")
console.log(error);
return error;
});
It works for every non PNG and PDF file.
Apparently if you're filename has whitespace in it, you will get a Could not create target file
while saving.