You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by GitBox <gi...@apache.org> on 2019/09/29 07:30:56 UTC

[GitHub] [cordova-plugin-file] azizbohra edited a comment on issue #350: Critical Issue: not working with external sdcard on phones like Samsung A7, Huawei etc

azizbohra edited a comment on issue #350: Critical Issue: not working with external sdcard on phones like Samsung A7, Huawei etc
URL: https://github.com/apache/cordova-plugin-file/issues/350#issuecomment-536261873
 
 
   > https://github.com/apache/cordova-contribute/blob/master/create-reproduction.md
   
   @breautek  Here is a link to repository having reproduction sample. 
   Please resolve this issue as soon as possible.
   https://github.com/azizbohra/reproduction-sample.git
   
   This is an issue with smartphones like **Samsung A7, A20, Huawei** etc
   When you choose file from external sdcard and call resolveLocalFileSystemURL function, it will throw an error **NOT_FOUND_ERROR** with **error code 1**
   
   I have used 3 cordova plugins to achieve this feature:
   1. cordova-plugin-file 6.0.2 "File"
   2. cordova-plugin-filechooser 1.2.0 "File Chooser"
   3. cordova-plugin-filepath 1.5.6 "cordova-plugin-filepath"
   
   Platform Info:
   8.1.2 (cordova-lib@8.1.1)
   android 7.1.4
   
   This is my code:
   
   `  var btnChooseFile = document.getElementById('chooseFile');
   
           btnChooseFile.addEventListener('click', function () {
               fileChooser.open(function (uri) { // this will give content://
   
                   window.FilePath.resolveNativePath(uri, function (path) { // this will give file://
   
                       window.resolveLocalFileSystemURL(path, function (fileEntry) {
                           alert('resolveLocalFileSystemURL success = ' + JSON.stringify(fileEntry));
   
                           fileEntry.file(function (file) {
                               var fileObj = {
                                   path: fileEntry.nativeURL,
                                   name: fileEntry.name,
                                   mimeType: file.type,
                                   size: file.size
                               };
   
                               alert('fileEntry success = ' + JSON.stringify(fileObj));
                           });
                       }, function (error) {
                           alert('resolveLocalFileSystemURL error = ' + JSON.stringify(error));
                       });
                   }, function (error) {
                       alert('resolveNativePath error = ' + JSON.stringify(error));
                   });
   
               }, function (error) {
                   alert(JSON.stringify(error));
               });
           });`
   
   ![WhatsApp Image 2019-09-29 at 10 01 01 AM](https://user-images.githubusercontent.com/38345295/65828358-b291f500-e2a2-11e9-9741-6b619a04b9d1.jpeg)
   

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

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