Google Groups

Re: [PhoneGap] Re: Error code 3 with FileTransfer.download and 1.5


Simon Apr 18, 2012 11:08 AM
Posted in group: phonegap
This is a bug, the library should be able to handle this case. I opened and fixed the issue for an upcoming release. 


I did a blog post with a work around and more details as how the bug slipped into 1.5.0.


and finally my apologies for having this bug sneak in. There was missing test coverage before the release but I've added some automated tests for this issue for future releases.

Simon Mac Donald
http://hi.im/simonmacdonald


On Wed, Apr 18, 2012 at 11:15 AM, jul...@prod-3d.com <jul...@prod-3d.com> wrote:
Fixed - See https://groups.google.com/forum/?fromgroups#!topic/phonegap/HEIiy5hh31w
++

Le mercredi 18 avril 2012 12:35:00 UTC+2, jul...@prod-3d.com a écrit :
Subscribing to Robert issue.

Wich is a duplicate from mine here : https://groups.google.com/forum/?fromgroups#!topic/phonegap/HEIiy5hh31w
Look like we're trying to do something wrong.
Can't seem to find what it is however.


Le mercredi 11 avril 2012 03:54:55 UTC+2, cory03 a écrit :
Add <feature name="http://api.phonegap.com/1.0/file"/> to the
config.xml

On Apr 10, 1:18 pm, jjboucheron <jjbouche...@gmail.com> wrote:
> Hi,
>
> It's the first time I use this kind of forum and I'm not sure you'll
> get my answer... Anyway I had the same problem. My problem was that
> the file wasn't created before I try  to put content (image for me) in
> it. I'm joining the code I used. It might help you.
>
> <!DOCTYPE html>
> <html>
> <head>
> <title>Contact Example</title>
>
> <script type="text/javascript" charset="utf-8"
>         src="javascript/cordova-1.5.0.js"></script>
> <script type="text/javascript" charset="utf-8" src="javascript/
> db.js"></script>
> <script type="text/javascript" charset="utf-8">
>
>     // Wait for PhoneGap to load
>     //
>     document.addEventListener("deviceready", onDeviceReady, false);
>
>     // PhoneGap is ready
>     //
>     function onDeviceReady() {
>         window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, gotPath,
> null);
>     }
>
>     function gotPath(fileSystem) {
>         console.log(fileSystem.name);
>         console.log(fileSystem.root.name);
>         // Get the data directory, creating it if it doesn't exist.
>
>         dataDir =
> fileSystem.root.getDirectory("data/"+YOUR_APPLICATION_NAME, {create:
> true},onSuccessTest, onFailTest);
>
>     }
>
>     // called when directory has been succesful got or created
>     function onSuccessTest(parent){
>         console.log("Parent Name: " + parent.name);
>         // file creation
>          lockFile = parent.getFile(YOUR_FILE_NAME, {create: true},
> succ, failCF);
>
>     }
>
>         // called when file has been successfully created
>     function succ(file){
>         console.log("toto"+ file.fullPath);
>         // in order to remove the "file:/" start
>         filePath=file.fullPath.substr(6);
>         console.log(filePath);
>          var fileTransfer = new FileTransfer();
>                 url = YOUR_URL;
>                 fileTransfer.download(
>                     url,
>                     filePath,
>                     function(entry) {
>                         console.log("download complete: " + entry.fullPath);
>                     },
>                     function(error) {
>                         console.log("download error source " +
> error.source);
>                         console.log("download error target " +
> error.target);
>                         console.log("upload error code" + error.code);
>                     }
>                 );
>     }
>
>     function failCF(){
>         console.log("File creation error");
>     }
>
>     function onFailTest(){
>         console.log("Error message");
>     }
>
>     </script>
> </head>
> <body>
>         <h1>Example</h1>
>         <p>Database</p>
> </body>
> </html>
>
> Hope It'll help :)
>
> On Apr 7, 3:51 pm, Alex <alessandro.pag...@gmail.com> wrote:
>
>
>
>
>
>
>
> > Hi Mike,
>
> > I have the same problem with Samsung Galaxy S2, Android API 8 and cordova
> > 1.5.
> > If I use instead PhoneGap 1.4.1 the download worked fine.
>
> > You have fixed it?
>
> > thanks,
>
> > AlexOn Thursday, March 29, 2012 12:16:20 AM UTC+2, Mike wrote:
>
> > > Hi,
>
> > > I was trying to add fileTransfer.Download to my project and kept
> > > getting error code 3, anyhow after trying many of things it was still
> > > a no go but when I built it with pg 1.41 it worked fine.
>
> > > Mike.

--
You received this message because you are subscribed to the Google
Groups "phonegap" group.
To post to this group, send email to phon...@googlegroups.com
To unsubscribe from this group, send email to
phonegap+u...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/phonegap?hl=en?hl=en
 
For more info on PhoneGap or to download the code go to www.phonegap.com