iampossible / Cordova-DocPicker

iOS plugin for Cordova writting in Swift.
11 stars 18 forks source link

Result filepath is incorrect when filename contains certain characters #16

Open kevinswartz opened 3 years ago

kevinswartz commented 3 years ago

Thanks so much for this great plugin!

I'm seeing an issue returning file paths for files that have certain characters in the file name. If the file name has a forward slash "/" character, it comes back with a ":" in the result file path. This filepath doesn't seem to map to a file, and causes issues when I try and do things with it. I would expect valid file paths returned here. In the case above, I was selecting a PDF, but the file type doesn't seem to make a difference.

I'm running v1.2.2, and here's the code I'm using:

          window.DocumentPicker.getFile(
            'all',
            function (res) {
              console.log('got ios files result', res)
              defer.resolve(res);
            },
            function (err) {
              console.log('error browsing files', err);
              defer.reject(err);
            })

Thanks for your help!