This is a migrated thread and some comments may be shown as answers.

FileTransfer Download problem Not_Found_Err

3 Answers 172 Views
Apache Cordova
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Roger
Top achievements
Rank 1
Roger asked on 29 Oct 2013, 05:42 AM
Hi,
am downloading a file from asp.net application as a stream to an icenium app using the following:
var ft = new FileTransfer();
           var uri = encodeURI('http://someserver/MobileSvc/attachment?id=EBE704C0-23B1-4E3F-9E9B-214A8BBD3320&recordID=1&appointmentID=22'); 
           ft.download(
               uri,
               'Document.pdf',
               function(entry){
                   alert('download complete: ' + entry.fullPath);
               },
               function(error){
                   var msg = 'download error source ' + error.source;
                       msg += '\ndownload error target ' + error.target;
                       msg += '\nupload error code ' + error.code;                      
                   alert(msg);
               },
               false
           )
Of course I get an error but it is error=1  or "Not_Found_Err'....so what does this error relate to and why isn't it creating the file? I can use the url in google to get the file data so that exists.
The file is not there to begin with  on Android(do I need to create it first then overwrite it?)
I saw on 1 forum that it was due to android permissions (doubtful as I can create directories) but addedthe line to the manifest file anyway

<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>

with no change.
I loaded a pdf onto the webserver and can directly view it by entering the address. When I use that same address and try and download I get the same old error?????

3 Answers, 1 is accepted

Sort by
0
Accepted
Roger
Top achievements
Rank 1
answered on 29 Oct 2013, 06:10 AM
Fix is in
Followed this guys post
https://gist.github.com/nathanpc/2464060

to get working example of  file transfer download (forget permissions etc).
Works a treat...now just have to ensure my documents can download like this.....
0
William
Top achievements
Rank 1
answered on 22 Aug 2014, 08:17 AM
I have a similar problem. This code works to Android, but not for Windows Phone. Anybody to know which is my error?
Folder_Name = "file://mnt/sdcard/Download";
for(var i = 0; i < images.length; i++) {

download_link = encodeURI(URL + images[i]);
fp = Folder_Name + "/" + images[i];

ftr = new FileTransfer();
ftr.download(download_link, fp, function (entry) {
alert("download complete: " + entry.fullPath);
}, function (error) {
alert('download error: ' + error.code);
alert("download error source " + error.source);
alert("download error target " + error.target);
});
0
Zdravko
Telerik team
answered on 26 Aug 2014, 01:03 PM
Hello William,

I am afraid you don't have a valid license in order to benefit from our support service, but you can still share and look for solutions among our community in our forum.

As a starting point I would bring your attention to our sample app which works as expected on WP 8 device.

Regards,
Zdravko
Telerik
 

Visit the Telerik Verified Plugins Marketplace and get the custom Cordova plugin you need, already tweaked to work seamlessly with AppBuilder.

 
Tags
Apache Cordova
Asked by
Roger
Top achievements
Rank 1
Answers by
Roger
Top achievements
Rank 1
William
Top achievements
Rank 1
Zdravko
Telerik team
Share this question
or