[jira] [Commented] (CB-6094) Cordova 3.4.0 Filetransfer download Error Code 1
[ https://issues.apache.org/jira/browse/CB-6094?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13936047#comment-13936047 ] Wolfgang Flohr-Hochbichler commented on CB-6094: The bug in jsHybugger described by Torsten Rosenberger was fixed in jsHybugger 4.2.6. Thank you for pointing it out. > Cordova 3.4.0 Filetransfer download Error Code 1 > > > Key: CB-6094 > URL: https://issues.apache.org/jira/browse/CB-6094 > Project: Apache Cordova > Issue Type: Bug > Components: Android, Plugin File Transfer >Affects Versions: 3.4.0 >Reporter: Torsten Rosenberger >Assignee: Ian Clelland > Labels: javascript > > Hello > I update my phonegap 3.0.1 to cordova 3.4.0. > But the same code which worked on 3.0.1 throw now a error > during downloading a file. > First i request a filesystem > window.requestFileSystem(LocalFileSystem.PERSISTENT,0,function(fileSystem) > all ok, then create a directory also ok. > remoteFile = 'http://www.example.com/myfile.png' > localPath = '/mydir/myfile.png' > var ft = new FileTransfer(); > ft.download(remoteFile,localPath, function(entry) { > }, > function(error) { > console.log(error); > console.log("download error source " + error.source); > console.log("download error target " + error.target); > console.log("download error code" + error.code); > } > ); > in mydir Directory the File myfile.png ist created with a size of 0 > Bytes. > and i got the error Code 1 (FILE_NOT_FOUND_ERR) > if i add file://mnt/sdcard/ to the localPath Variable the download is > sucessfull. But with the new Version i get > / for the fileSystem.root.fullPath as descriped in the changlog of 3.4.0 > maybe i doing something wrong with the new filesystem path to the root > directory ? > BR/Torsten -- This message was sent by Atlassian JIRA (v6.2#6252)
[jira] [Commented] (CB-6094) Cordova 3.4.0 Filetransfer download Error Code 1
[ https://issues.apache.org/jira/browse/CB-6094?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13912757#comment-13912757 ] Torsten Rosenberger commented on CB-6094: - Hello again. so i tried the dev branche with no result. BUT. I created a new hello world app with your code and all worked fine. In my app still the same error. I created a new app copied my files to it run and all was OK! I installed my used plugins step by step and run the app after i installed one. The bug is in the jshybugger plugin https://www.jshybugger.com/ it works with cordova 3.3.0 but make a error in 3.4.0 with the FileTransfer plugin. Sorry for the work. BR/Torsten > Cordova 3.4.0 Filetransfer download Error Code 1 > > > Key: CB-6094 > URL: https://issues.apache.org/jira/browse/CB-6094 > Project: Apache Cordova > Issue Type: Bug > Components: Android, Plugin File Transfer >Affects Versions: 3.4.0 >Reporter: Torsten Rosenberger >Assignee: Ian Clelland > Labels: javascript > > Hello > I update my phonegap 3.0.1 to cordova 3.4.0. > But the same code which worked on 3.0.1 throw now a error > during downloading a file. > First i request a filesystem > window.requestFileSystem(LocalFileSystem.PERSISTENT,0,function(fileSystem) > all ok, then create a directory also ok. > remoteFile = 'http://www.example.com/myfile.png' > localPath = '/mydir/myfile.png' > var ft = new FileTransfer(); > ft.download(remoteFile,localPath, function(entry) { > }, > function(error) { > console.log(error); > console.log("download error source " + error.source); > console.log("download error target " + error.target); > console.log("download error code" + error.code); > } > ); > in mydir Directory the File myfile.png ist created with a size of 0 > Bytes. > and i got the error Code 1 (FILE_NOT_FOUND_ERR) > if i add file://mnt/sdcard/ to the localPath Variable the download is > sucessfull. But with the new Version i get > / for the fileSystem.root.fullPath as descriped in the changlog of 3.4.0 > maybe i doing something wrong with the new filesystem path to the root > directory ? > BR/Torsten -- This message was sent by Atlassian JIRA (v6.1.5#6160)
[jira] [Commented] (CB-6094) Cordova 3.4.0 Filetransfer download Error Code 1
[ https://issues.apache.org/jira/browse/CB-6094?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13911640#comment-13911640 ] Ian Clelland commented on CB-6094: -- I haven't been able to reproduce this yet. From your error log, it would appear that CordovaResourceApi.remapUri is not translating the {{cdvfile://}} URL into a {{file:///}} URL properly, but the only case where that would happen is if the File plugin hadn't been loaded yet. If you are creating the directories before you try to download the file, then the File plugin, I believe, *has* to be loaded. Because of the potential for this issue, I recently changed File to load on startup (CB-6087). That change is just on dev now, but should be released very soon as File v1.0.1. If you want to try using that, you can check out the dev branch of https://github.com/apache/cordova-plugin-file, and see if that fixes things for you. Here is the test code that I've been running (I've tried this with both released and dev versions of file and file-transfer, and it hasn't failed yet): {code} window.requestFileSystem(LocalFileSystem.PERSISTENT,0,function(fileSystem) { var omadir = 'user1'; fileSystem.root.getDirectory('1oma/', {create: true}, function (dirEntry) { fileSystem.root.getDirectory('1oma/' + omadir, {create: true}, function (dirUser) { alert("Created both directories"); var movieURL = "http://techslides.com/demos/sample-videos/small.mp4";; var ft = new FileTransfer(); ft.download(movieURL, dirUser.toURL() + "/movie.mp4", function(entry) { alert("Download successful"); console.log(entry); }, function(err) { alert("Download failure: " + JSON.stringify(err)); }); }, function(err) { alert("2nd getDirectory failure: " + JSON.stringify(err)); }); }, function(err) { alert("1st getDirectory failure: " + JSON.stringify(err)); }); }, function(err) { alert("requestFileSystem failure: " + JSON.stringify(err)); }); {code} After running it, I'm checking the file system on the device: {code} macbookpro:~/dltest$ adb shell shell@flo:/ $ cd /sdcard/1oma/ shell@flo:/sdcard/1oma $ ls user1 shell@flo:/sdcard/1oma $ cd user1/ shell@flo:/sdcard/1oma/user1 $ ls -l -rw-rw root sdcard_r 383631 2014-02-25 09:41 movie.mp4 shell@flo:/sdcard/1oma/user1 $ {code} > Cordova 3.4.0 Filetransfer download Error Code 1 > > > Key: CB-6094 > URL: https://issues.apache.org/jira/browse/CB-6094 > Project: Apache Cordova > Issue Type: Bug > Components: Android, Plugin File Transfer >Affects Versions: 3.4.0 >Reporter: Torsten Rosenberger >Assignee: Ian Clelland > Labels: javascript > > Hello > I update my phonegap 3.0.1 to cordova 3.4.0. > But the same code which worked on 3.0.1 throw now a error > during downloading a file. > First i request a filesystem > window.requestFileSystem(LocalFileSystem.PERSISTENT,0,function(fileSystem) > all ok, then create a directory also ok. > remoteFile = 'http://www.example.com/myfile.png' > localPath = '/mydir/myfile.png' > var ft = new FileTransfer(); > ft.download(remoteFile,localPath, function(entry) { > }, > function(error) { > console.log(error); > console.log("download error source " + error.source); > console.log("download error target " + error.target); > console.log("download error code" + error.code); > } > ); > in mydir Directory the File myfile.png ist created with a size of 0 > Bytes. > and i got the error Code 1 (FILE_NOT_FOUND_ERR) > if i add file://mnt/sdcard/ to the localPath Variable the download is > sucessfull. But with the new Version i get > / for the fileSystem.root.fullPath as descriped in the changlog of 3.4.0 > maybe i doing something wrong with the new filesystem path to the root > directory ? > BR/Torsten -- This message was sent by Atlassian JIRA (v6.1.5#6160)
[jira] [Commented] (CB-6094) Cordova 3.4.0 Filetransfer download Error Code 1
[ https://issues.apache.org/jira/browse/CB-6094?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13910684#comment-13910684 ] Ian Clelland commented on CB-6094: -- Thanks, [~torstahl] -- that is helpful; I'll see if I can get to the bottom of that and get a fix for you to try. > Cordova 3.4.0 Filetransfer download Error Code 1 > > > Key: CB-6094 > URL: https://issues.apache.org/jira/browse/CB-6094 > Project: Apache Cordova > Issue Type: Bug > Components: Android, Plugin File Transfer >Affects Versions: 3.4.0 >Reporter: Torsten Rosenberger >Assignee: Ian Clelland > Labels: javascript > > Hello > I update my phonegap 3.0.1 to cordova 3.4.0. > But the same code which worked on 3.0.1 throw now a error > during downloading a file. > First i request a filesystem > window.requestFileSystem(LocalFileSystem.PERSISTENT,0,function(fileSystem) > all ok, then create a directory also ok. > remoteFile = 'http://www.example.com/myfile.png' > localPath = '/mydir/myfile.png' > var ft = new FileTransfer(); > ft.download(remoteFile,localPath, function(entry) { > }, > function(error) { > console.log(error); > console.log("download error source " + error.source); > console.log("download error target " + error.target); > console.log("download error code" + error.code); > } > ); > in mydir Directory the File myfile.png ist created with a size of 0 > Bytes. > and i got the error Code 1 (FILE_NOT_FOUND_ERR) > if i add file://mnt/sdcard/ to the localPath Variable the download is > sucessfull. But with the new Version i get > / for the fileSystem.root.fullPath as descriped in the changlog of 3.4.0 > maybe i doing something wrong with the new filesystem path to the root > directory ? > BR/Torsten -- This message was sent by Atlassian JIRA (v6.1.5#6160)
[jira] [Commented] (CB-6094) Cordova 3.4.0 Filetransfer download Error Code 1
[ https://issues.apache.org/jira/browse/CB-6094?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13910636#comment-13910636 ] Torsten Rosenberger commented on CB-6094: - the logcat output D/FileTransfer( 1439): download http://develop.taoweb.at/customer/417/1oma/1121/oma1392149482.jpg to cdvfile://localhost/persistent/1oma/1121/oma1392149482.jpg E/FileTransfer( 1439): {"target":"cdvfile:\/\/localhost\/persistent\/1oma\/1121\/oma1392149482.jpg","source":"http:\/\/develop.taoweb.at\/customer\/417\/1oma\/1121\/oma1392149482.jpg","http_status":0,"code":1} E/FileTransfer( 1439): java.io.FileNotFoundException: URI not supported by CordovaResourceApi: cdvfile://localhost/persistent/1oma/1121/oma1392149482.jpg E/FileTransfer( 1439): at org.apache.cordova.CordovaResourceApi.openOutputStream(CordovaResourceApi.java:301) E/FileTransfer( 1439): at org.apache.cordova.CordovaResourceApi.openOutputStream(CordovaResourceApi.java:274) E/FileTransfer( 1439): at org.apache.cordova.filetransfer.FileTransfer$4.run(FileTransfer.java:708) E/FileTransfer( 1439): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076) E/FileTransfer( 1439): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569) E/FileTransfer( 1439): at java.lang.Thread.run(Thread.java:856) > Cordova 3.4.0 Filetransfer download Error Code 1 > > > Key: CB-6094 > URL: https://issues.apache.org/jira/browse/CB-6094 > Project: Apache Cordova > Issue Type: Bug > Components: Android, Plugin File Transfer >Affects Versions: 3.4.0 >Reporter: Torsten Rosenberger >Assignee: Ian Clelland > Labels: javascript > > Hello > I update my phonegap 3.0.1 to cordova 3.4.0. > But the same code which worked on 3.0.1 throw now a error > during downloading a file. > First i request a filesystem > window.requestFileSystem(LocalFileSystem.PERSISTENT,0,function(fileSystem) > all ok, then create a directory also ok. > remoteFile = 'http://www.example.com/myfile.png' > localPath = '/mydir/myfile.png' > var ft = new FileTransfer(); > ft.download(remoteFile,localPath, function(entry) { > }, > function(error) { > console.log(error); > console.log("download error source " + error.source); > console.log("download error target " + error.target); > console.log("download error code" + error.code); > } > ); > in mydir Directory the File myfile.png ist created with a size of 0 > Bytes. > and i got the error Code 1 (FILE_NOT_FOUND_ERR) > if i add file://mnt/sdcard/ to the localPath Variable the download is > sucessfull. But with the new Version i get > / for the fileSystem.root.fullPath as descriped in the changlog of 3.4.0 > maybe i doing something wrong with the new filesystem path to the root > directory ? > BR/Torsten -- This message was sent by Atlassian JIRA (v6.1.5#6160)
[jira] [Commented] (CB-6094) Cordova 3.4.0 Filetransfer download Error Code 1
[ https://issues.apache.org/jira/browse/CB-6094?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13910474#comment-13910474 ] Ian Clelland commented on CB-6094: -- As far as I can see, FILE_NOT_FOUND_ERR is only returned from {{FileTransfer.download}} if a FileNotFoundException is raised during (or right before) the download). Since the file is being created, I would think that the {{CordovaResourceApi.openOutputStream()}} call is successful, and that the error is occurring sometime after that in {{FIleTransfer.download}} There are a few method calls in FileTransfer.java that could raise a FIleNotFoundException. Before returning the error to JavaScript, though, it should log the exception with all of its details to the Android log. Can you find the logs that are output by FileTransfer? > Cordova 3.4.0 Filetransfer download Error Code 1 > > > Key: CB-6094 > URL: https://issues.apache.org/jira/browse/CB-6094 > Project: Apache Cordova > Issue Type: Bug > Components: Android, Plugin File Transfer >Affects Versions: 3.4.0 >Reporter: Torsten Rosenberger >Assignee: Ian Clelland > Labels: javascript > > Hello > I update my phonegap 3.0.1 to cordova 3.4.0. > But the same code which worked on 3.0.1 throw now a error > during downloading a file. > First i request a filesystem > window.requestFileSystem(LocalFileSystem.PERSISTENT,0,function(fileSystem) > all ok, then create a directory also ok. > remoteFile = 'http://www.example.com/myfile.png' > localPath = '/mydir/myfile.png' > var ft = new FileTransfer(); > ft.download(remoteFile,localPath, function(entry) { > }, > function(error) { > console.log(error); > console.log("download error source " + error.source); > console.log("download error target " + error.target); > console.log("download error code" + error.code); > } > ); > in mydir Directory the File myfile.png ist created with a size of 0 > Bytes. > and i got the error Code 1 (FILE_NOT_FOUND_ERR) > if i add file://mnt/sdcard/ to the localPath Variable the download is > sucessfull. But with the new Version i get > / for the fileSystem.root.fullPath as descriped in the changlog of 3.4.0 > maybe i doing something wrong with the new filesystem path to the root > directory ? > BR/Torsten -- This message was sent by Atlassian JIRA (v6.1.5#6160)
[jira] [Commented] (CB-6094) Cordova 3.4.0 Filetransfer download Error Code 1
[ https://issues.apache.org/jira/browse/CB-6094?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13910359#comment-13910359 ] Torsten Rosenberger commented on CB-6094: - the directory exists. I create it before downloading the file {code} window.requestFileSystem(LocalFileSystem.PERSISTENT,0,function(fileSystem) { fileSystem.root.getDirectory('1oma/', {create: true}, function (dirEntry) { fileSystem.root.getDirectory('1oma/' + omadir, {create: true}, function (dirUser) { {code} if i look in a directory manager i see that the file /1oma/1121/oma1392149482.jpg is created but with a size of 0KB > Cordova 3.4.0 Filetransfer download Error Code 1 > > > Key: CB-6094 > URL: https://issues.apache.org/jira/browse/CB-6094 > Project: Apache Cordova > Issue Type: Bug > Components: Android >Affects Versions: 3.4.0 >Reporter: Torsten Rosenberger >Assignee: Ian Clelland > Labels: javascript > > Hello > I update my phonegap 3.0.1 to cordova 3.4.0. > But the same code which worked on 3.0.1 throw now a error > during downloading a file. > First i request a filesystem > window.requestFileSystem(LocalFileSystem.PERSISTENT,0,function(fileSystem) > all ok, then create a directory also ok. > remoteFile = 'http://www.example.com/myfile.png' > localPath = '/mydir/myfile.png' > var ft = new FileTransfer(); > ft.download(remoteFile,localPath, function(entry) { > }, > function(error) { > console.log(error); > console.log("download error source " + error.source); > console.log("download error target " + error.target); > console.log("download error code" + error.code); > } > ); > in mydir Directory the File myfile.png ist created with a size of 0 > Bytes. > and i got the error Code 1 (FILE_NOT_FOUND_ERR) > if i add file://mnt/sdcard/ to the localPath Variable the download is > sucessfull. But with the new Version i get > / for the fileSystem.root.fullPath as descriped in the changlog of 3.4.0 > maybe i doing something wrong with the new filesystem path to the root > directory ? > BR/Torsten -- This message was sent by Atlassian JIRA (v6.1.5#6160)
[jira] [Commented] (CB-6094) Cordova 3.4.0 Filetransfer download Error Code 1
[ https://issues.apache.org/jira/browse/CB-6094?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13910353#comment-13910353 ] Ian Clelland commented on CB-6094: -- \[It looks like JIRA mangled your last comment there -- you can put your entire paste between two lines that just say "{{\{code\}}}" and it will format it for you\] Using the {{cdvfile}} URL *should* work -- is it possible that the problem is that the "{{/1oma/1121/}}" directories don't exist yet? I'll check to see whether the previous version of file-transfer would have created them automatically. Are there any other error messages in the Android log that would be relevant here? > Cordova 3.4.0 Filetransfer download Error Code 1 > > > Key: CB-6094 > URL: https://issues.apache.org/jira/browse/CB-6094 > Project: Apache Cordova > Issue Type: Bug > Components: Android >Affects Versions: 3.4.0 >Reporter: Torsten Rosenberger >Assignee: Ian Clelland > Labels: javascript > > Hello > I update my phonegap 3.0.1 to cordova 3.4.0. > But the same code which worked on 3.0.1 throw now a error > during downloading a file. > First i request a filesystem > window.requestFileSystem(LocalFileSystem.PERSISTENT,0,function(fileSystem) > all ok, then create a directory also ok. > remoteFile = 'http://www.example.com/myfile.png' > localPath = '/mydir/myfile.png' > var ft = new FileTransfer(); > ft.download(remoteFile,localPath, function(entry) { > }, > function(error) { > console.log(error); > console.log("download error source " + error.source); > console.log("download error target " + error.target); > console.log("download error code" + error.code); > } > ); > in mydir Directory the File myfile.png ist created with a size of 0 > Bytes. > and i got the error Code 1 (FILE_NOT_FOUND_ERR) > if i add file://mnt/sdcard/ to the localPath Variable the download is > sucessfull. But with the new Version i get > / for the fileSystem.root.fullPath as descriped in the changlog of 3.4.0 > maybe i doing something wrong with the new filesystem path to the root > directory ? > BR/Torsten -- This message was sent by Atlassian JIRA (v6.1.5#6160)
[jira] [Commented] (CB-6094) Cordova 3.4.0 Filetransfer download Error Code 1
[ https://issues.apache.org/jira/browse/CB-6094?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13910336#comment-13910336 ] Torsten Rosenberger commented on CB-6094: - Hello i tried this already. Forgot to write it. The result with toURL(). download error source http://develop.taoweb.at/customer/417/1oma/1121/oma1392149482.jpg download error target cdvfile://localhost/persistent/1oma/1121/oma1392149482.jpg download error code1 SDCAD / - cdvfile://localhost/persistent/ Object {code: 1, source: "http://develop.taoweb.at/customer/417/1oma/1121/oma1392110145.jpg";, target: "cdvfile://localhost/persistent/1oma/1121/oma1392110145.jpg", http_status: , body: } > Cordova 3.4.0 Filetransfer download Error Code 1 > > > Key: CB-6094 > URL: https://issues.apache.org/jira/browse/CB-6094 > Project: Apache Cordova > Issue Type: Bug > Components: Android >Affects Versions: 3.4.0 >Reporter: Torsten Rosenberger >Assignee: Ian Clelland > Labels: javascript > > Hello > I update my phonegap 3.0.1 to cordova 3.4.0. > But the same code which worked on 3.0.1 throw now a error > during downloading a file. > First i request a filesystem > window.requestFileSystem(LocalFileSystem.PERSISTENT,0,function(fileSystem) > all ok, then create a directory also ok. > remoteFile = 'http://www.example.com/myfile.png' > localPath = '/mydir/myfile.png' > var ft = new FileTransfer(); > ft.download(remoteFile,localPath, function(entry) { > }, > function(error) { > console.log(error); > console.log("download error source " + error.source); > console.log("download error target " + error.target); > console.log("download error code" + error.code); > } > ); > in mydir Directory the File myfile.png ist created with a size of 0 > Bytes. > and i got the error Code 1 (FILE_NOT_FOUND_ERR) > if i add file://mnt/sdcard/ to the localPath Variable the download is > sucessfull. But with the new Version i get > / for the fileSystem.root.fullPath as descriped in the changlog of 3.4.0 > maybe i doing something wrong with the new filesystem path to the root > directory ? > BR/Torsten -- This message was sent by Atlassian JIRA (v6.1.5#6160)
[jira] [Commented] (CB-6094) Cordova 3.4.0 Filetransfer download Error Code 1
[ https://issues.apache.org/jira/browse/CB-6094?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13910307#comment-13910307 ] Ian Clelland commented on CB-6094: -- If you use {{.toURL()}} instead of {{.fullPath}}, you should get something like {{cdvfile://localhost/persistent/}}, which *is* usable as a destination for {{FileTransfer.download}}. Try doing this for your download command: {code} ft.download(remoteFile,fileSystem.root.toURL() + localPath, function(entry) { {code} > Cordova 3.4.0 Filetransfer download Error Code 1 > > > Key: CB-6094 > URL: https://issues.apache.org/jira/browse/CB-6094 > Project: Apache Cordova > Issue Type: Bug > Components: Android >Affects Versions: 3.4.0 >Reporter: Torsten Rosenberger > Labels: javascript > > Hello > I update my phonegap 3.0.1 to cordova 3.4.0. > But the same code which worked on 3.0.1 throw now a error > during downloading a file. > First i request a filesystem > window.requestFileSystem(LocalFileSystem.PERSISTENT,0,function(fileSystem) > all ok, then create a directory also ok. > remoteFile = 'http://www.example.com/myfile.png' > localPath = '/mydir/myfile.png' > var ft = new FileTransfer(); > ft.download(remoteFile,localPath, function(entry) { > }, > function(error) { > console.log(error); > console.log("download error source " + error.source); > console.log("download error target " + error.target); > console.log("download error code" + error.code); > } > ); > in mydir Directory the File myfile.png ist created with a size of 0 > Bytes. > and i got the error Code 1 (FILE_NOT_FOUND_ERR) > if i add file://mnt/sdcard/ to the localPath Variable the download is > sucessfull. But with the new Version i get > / for the fileSystem.root.fullPath as descriped in the changlog of 3.4.0 > maybe i doing something wrong with the new filesystem path to the root > directory ? > BR/Torsten -- This message was sent by Atlassian JIRA (v6.1.5#6160)