Kal
Posts: 0
Joined: Thu May 22, 2014 11:03 pm

File API has bugs since the new update.

Hi, I am downloading a file to local storage, if it does not already exist. I used the method from this article:
http://stackoverflow.com/questions/10...

I used the popular ones suggested by Thomas and Kurt (16 and 15 votes), and it has always worked fine, UNTIL this weekend's update. Now, it is broken. I have shared a project with a href="mailto:support@appery.io" rel="nofollow"support@appery.io/a (Problems10-20-14) that illustrates this at the bottom part of the screen (the top part of the screen illustrates a different problem). To reproduce the problem,

  1. build the APK and run on any Android device.

  2. Bring up the app, click on Check#1 and Check#2. Both will report negative.

  3. Then click on Download. This will download Big Buck video to DCIM folder.

  4. Again, click on Check#1 and Check#2. Now, Check#1 will fail and other succeeds.

    If you look at the code, Check#1 is the code that uses the File API from Phonegap as suggested in the popular answer above. Check#2 is the least popular answer at the end of that post, which uses an ajax call to check for the file. Surprisingly that works very well even now. As I said, Check#1 USED to work fine until this weekend. It was very upsetting that it suddenly stopped working after a platform update.

    I have now switched to Check#2 in my code, so I have a work around. But, I just wanted to point out that something is very broken in the current build software. A basic Cordova API should not suddenly stop working!

    Thanks,
    -Kal.

Evgene Karachevtsev
Posts: 12
Joined: Mon Apr 28, 2014 1:12 pm

File API has bugs since the new update.

Hello Kal,

Please try this code:
prewindow.resolveLocalFileSystemURI("file:///"+window.pathName, onResolveSuccess, fail);

function onResolveSuccess(fileEntry) {
alert("File exists");
}

function fail(error) {
alert("There is no such file");
}/pre

Kal
Posts: 0
Joined: Thu May 22, 2014 11:03 pm

File API has bugs since the new update.

Yes, that works too, thanks, Evgene.

As I said the Ajax way works as well, but the weird thing is that the way I had it before worked until Saturday, and then stopped working. I was wondering if there is an explanation for that, like new version of jQuery or something? I just want to be sure that no other bugs are lying hidden...

Thanks,
-Kal.

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

File API has bugs since the new update.

Hi Kal,

We upgraded PhoneGap version to 3.6.3 and jQuery Mobile version to 1.4.4 on Sunday.

Return to “Issues”