You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by GitBox <gi...@apache.org> on 2022/06/09 09:52:49 UTC

[GitHub] [cordova-plugin-file] lovelyelfpop opened a new issue, #525: @7.0.0 resolveLocalFileSystemURL a content uri get a FileError

lovelyelfpop opened a new issue, #525:
URL: https://github.com/apache/cordova-plugin-file/issues/525

   # Bug Report
   
   ## Problem
   resolveLocalFileSystemURL a content uri get FileErrorĀ 
   
   
   ### What is expected to happen?
   ```javascript
   window.resolveLocalFileSystemURL('content://com.android.providers.media.documents/document/image%3A189210', function (fileEntry) {
       console.log(fileEntry); 
   }, function(err) {
       console.log(err)
   });
   ```
   It got a FileError (code 1, not found)
   
   ### What does actually happen?
   It should log the fileEntry in the console
   
   
   ## Information
   
   ### Environment, Platform, Device
   Redmi K30 pro, Android 11
   
   
   
   ### Version information
   Cordova@11.0.0
   Cordova-Android@10.1.2
   cordova-plugin-file@7.0.0
   
   
   
   ## Checklist
   <!-- Please check the boxes by putting an x in the [ ] like so: [x] -->
   
   - [x] I searched for existing GitHub issues
   - [x] I updated all Cordova tooling to most recent version
   - [x] I included all the necessary information above
   
   
   
   ## Reason
   The code below inside function `toNativeUri` in `org\apache\cordova\file\ContentFilesystem.java`
   ```java
   String authorityAndPath = inputURL.uri.getEncodedPath().substring(this.name.length() + 2);
   ```
   got `e_content__/com.android.providers.media.documents/document/image%3A189210`
   
   It should be
   `com.android.providers.media.documents/document/image%3A189210`
   
   The right code is:
   ```java
   String encodedPath = inputURL.uri.getEncodedPath();
   String authorityAndPath = encodedPath.substring(encodedPath.indexOf(this.name) + 1 + this.name.length() + 2);
   ```
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


[GitHub] [cordova-plugin-file] grassick commented on issue #525: @7.0.0 resolveLocalFileSystemURL a content uri get a FileError

Posted by GitBox <gi...@apache.org>.
grassick commented on issue #525:
URL: https://github.com/apache/cordova-plugin-file/issues/525#issuecomment-1205356754

   I've created a PR at https://github.com/apache/cordova-plugin-file/pull/534


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


[GitHub] [cordova-plugin-file] lovelyelfpop commented on issue #525: @7.0.0 resolveLocalFileSystemURL a content uri get a FileError

Posted by "lovelyelfpop (via GitHub)" <gi...@apache.org>.
lovelyelfpop commented on issue #525:
URL: https://github.com/apache/cordova-plugin-file/issues/525#issuecomment-1436246382

   When will this gets merged?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


[GitHub] [cordova-plugin-file] mirko77 commented on issue #525: @7.0.0 resolveLocalFileSystemURL a content uri get a FileError

Posted by "mirko77 (via GitHub)" <gi...@apache.org>.
mirko77 commented on issue #525:
URL: https://github.com/apache/cordova-plugin-file/issues/525#issuecomment-1472227571

   @grassick I tried your fork but I still get error 1.
   
    `file_URI = 'content://com.android.providers.downloads.documents/document/raw%3A%2Fstorage%2Femulated%2F0%2FDownload%2F00052123047880195188.pdf'`
   
   ```
    window.resolveLocalFileSystemURL(file_URI, _onSuccess, _onError);
   ```
   
   always error 1. 
   
   Works in 6.0.2, by using the default android file picker, but it fails again (error 1) when using a third-party one, like Solid Explorer.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


[GitHub] [cordova-plugin-file] brunolau commented on issue #525: @7.0.0 resolveLocalFileSystemURL a content uri get a FileError

Posted by GitBox <gi...@apache.org>.
brunolau commented on issue #525:
URL: https://github.com/apache/cordova-plugin-file/issues/525#issuecomment-1344390726

   Any ETA when this gets merged / fixed ? 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


[GitHub] [cordova-plugin-file] breautek commented on issue #525: @7.0.0 resolveLocalFileSystemURL a content uri get a FileError

Posted by GitBox <gi...@apache.org>.
breautek commented on issue #525:
URL: https://github.com/apache/cordova-plugin-file/issues/525#issuecomment-1207312322

   Believe it's a regression of https://github.com/apache/cordova-plugin-file/pull/513 but not 100% sure. PR doesn't describe changes to `content://` scheme specifically but I believe any scheme other than the http/https scheme has issues when using the WebViewAssetLoader.
   
   PR looks good though.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


[GitHub] [cordova-plugin-file] HarelM commented on issue #525: @7.0.0 resolveLocalFileSystemURL a content uri get a FileError

Posted by GitBox <gi...@apache.org>.
HarelM commented on issue #525:
URL: https://github.com/apache/cordova-plugin-file/issues/525#issuecomment-1203767040

   @grassick I suggest to open a PR, I agree that this is a serious bug. I'm surprised there isn't a test to check that `toNativeUrl` and `toLocalUrl` are symmetric - i.e. that you can create a situation where this basically fails.
   If there is a PR then someone can help pushing it to be merged by helping out with the tests.
   In any way, thanks for sharing your solution!
   I also guess that reverting to version 6.x will also solve this, right?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


[GitHub] [cordova-plugin-file] HarelM commented on issue #525: @7.0.0 resolveLocalFileSystemURL a content uri get a FileError

Posted by GitBox <gi...@apache.org>.
HarelM commented on issue #525:
URL: https://github.com/apache/cordova-plugin-file/issues/525#issuecomment-1205358859

   Yea, thanks! Saw that only after posting here...


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


[GitHub] [cordova-plugin-file] erisu closed issue #525: @7.0.0 resolveLocalFileSystemURL a content uri get a FileError

Posted by "erisu (via GitHub)" <gi...@apache.org>.
erisu closed issue #525: @7.0.0 resolveLocalFileSystemURL a content uri get a FileErrorĀ 
URL: https://github.com/apache/cordova-plugin-file/issues/525


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


[GitHub] [cordova-plugin-file] grassick commented on issue #525: @7.0.0 resolveLocalFileSystemURL a content uri get a FileError

Posted by GitBox <gi...@apache.org>.
grassick commented on issue #525:
URL: https://github.com/apache/cordova-plugin-file/issues/525#issuecomment-1190908025

   I've implemented this change here: https://github.com/mWater/cordova-plugin-file.git#fix-issue-525 so feel free to use this until this gets fixed.
   
   I started to make a pull request, but the overhead to do so was too high (run tests, without clear instructions in README, etc). If someone else would like to, please go ahead. This is a pretty serious bug.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


[GitHub] [cordova-plugin-file] mirko77 commented on issue #525: @7.0.0 resolveLocalFileSystemURL a content uri get a FileError

Posted by "mirko77 (via GitHub)" <gi...@apache.org>.
mirko77 commented on issue #525:
URL: https://github.com/apache/cordova-plugin-file/issues/525#issuecomment-1472342204

   @grassick I have been trying your fork and it works.
   
   However, a few users reported issues when using Solid Explorer to browse files on the device. 
   So when trying to resolve a URL like `content://pl.solidexplorer2.files/storage/emulated/0/Download/ORARI-NUOTO-LIBERO-dal-13-al-18-settembre-2022.pdf`, error 1 is still returned. Any ideas? Any URL returned by Solid Explorer fails with error 1.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org