cordova-plugin-file icon indicating copy to clipboard operation
cordova-plugin-file copied to clipboard

Unable to open content from Dropbox

Open Dennismweldy opened this issue 5 years ago • 1 comments
trafficstars

Bug Report

When we try to open a file via an intent from the dropbox application (168.2.2) with the cordova plugin 6.0.1 it fails.

Problem

The resolveLocalFileSystemURL fails when trying to retrieve the modofied date. this

What is expected to happen?

We should be able to retrieve the file entry

What does actually happen?

It fails.

Information

the problem is that dropbox returns a string of the form Weekday, Day Month Year Hour:MInutes:Seconds OffsetFrom GMT Ex: Mon, 21 Oct 2019 14:49:59 -05:00 which is not able to be parsed as a long.

Command or Code

The method used is resolveLocalFileSystemURL, which eventually calls the function lastModifiedDateForCursor in contentFileSystem.java

    if (columnIndex != -1) {
        String dateStr = cursor.getString(columnIndex);
        if (dateStr != null) {
            return Long.parseLong(dateStr);
        }
    }

Environment, Platform, Device

Android Pixel 2

Version information

Cordova: 7.1 Cordova-plugin-file: 6.0.1 android platform: 6.4.0 Other Frameworks: AngularJS Android : 10 Dropbox 168.2.2

Checklist

  • [x] I searched for existing GitHub issues
  • [ ] I updated all Cordova tooling to most recent version
  • [x] I included all the necessary information above

Dennismweldy avatar Nov 26 '19 21:11 Dennismweldy

We cant update to most recent toolings as we have to continue using Visual Studion 2017 for the forseeable future. We only recently found that the site which showed how to upgrade VS 2017 from 6.3.1 to 7.1 does have instructions on upgrading to 9.0. I do note that I looked at the file and I dont see the needed exception handler, and so would have the same problem.

Dennismweldy avatar Nov 26 '19 21:11 Dennismweldy