I'm downloading a multi-part mime encoded image to iOS like this:
var ft = new FileTransfer();
url = encodeURI(url);
ft.download(url, path, function(fileEntry) {}, function(err) {});
with
path = "file://localhost/var/mobile/Applications/D702F059-A29F-4FF4-A165-D4A903DEDE7D/Documents/captured/2419747919.jpeg"
and get the following error:
body: "Could not create path to save downloaded file: The operation couldn’t be completed. (Cocoa error 513.)"
code: 1 (file not found)
http status: 200
This hints to an invalid path, but I can't see anything wrong with it. I get the path like this:
path = fs.root.toURL();
Everything else works fine and files can be stored in exactly the same path by taking photos. Just not via a FileTransfer download.
Any ideas or a bug in Phonegap 3.0? Thanks!
UPDATE - Workaround
FileWriter works and now even saves blobs on iOS and Android. Example code:
var xhr = new XMLHttpRequest();
xhr.open('GET', url, true);
xhr.responseType = 'arraybuffer';
xhr.onload = function() {
var blob = new Blob([xhr.response], {type: 'image/jpeg'});
// save via FileWriter
};
xhr.send();