Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compatibility with cordova-plugin-file@7 Android URLs #339

Open
kryops opened this issue Jun 14, 2022 · 14 comments
Open

Compatibility with cordova-plugin-file@7 Android URLs #339

kryops opened this issue Jun 14, 2022 · 14 comments
Milestone

Comments

@kryops
Copy link

kryops commented Jun 14, 2022

Hi there,

the new release 7.0.0 of cordova-plugin-file changed the format of URLs generated via file.toURL() and file.toInternalURL() from cdvfile://localhost/persistent/... to https://localhost/__cdvfile_persistent__/... on Android. This plugin does not seem to be able to handle them yet.

As a workaround, I am currently using file.nativeURL, which seems to work quite well.

Thanks for looking into it!

@pixellet14
Copy link

Hi, I have also encountered that after installing this plugin the build fails. It is showing incompatibility issues

@phusting
Copy link

me too

@pixellet14
Copy link

@phusting I have found the solution

@phusting
Copy link

phusting commented Oct 22, 2022

@pixellet14 , AND?! :o) I'm using iOS and Android and I would love to continue to use file-transfer plugin if possible

@pixellet14
Copy link

@phusting
Copy link

@pixellet14 I will give it a try tomorrow. Thanks

@pixellet14
Copy link

@phusting https://www.npmjs.com/package/cordova-plugin-ns0m-file-transfer
This works!!! trust me!! i have just tried it

@phusting
Copy link

@pixellet14 you tested with plugin-file v7?

@phusting
Copy link

phusting commented Oct 26, 2022

@phusting https://www.npmjs.com/package/cordova-plugin-ns0m-file-transfer This works!!! trust me!! i have just tried it

I get Invalid Version: null

@pixellet14
Copy link

@phusting what's your cordova version? I am using 11

@pixellet14
Copy link

pixellet14 commented Oct 28, 2022

@phusting see this...ignore the Response, as I haven't returned any json response in my serverside

Record_2022-10-28-20-04-36.mp4

@michaelpeterlee
Copy link

@phusting https://www.npmjs.com/package/cordova-plugin-ns0m-file-transfer This works!!! trust me!! i have just tried it

I get Invalid Version: null

I received that also, however after installing via npm and then via cordova it built albeit does not solve the problem still.

@terryjiang2020
Copy link

I start wondering if this plugin is still being maintained.

@rolinger
Copy link

rolinger commented Mar 1, 2023

@phusting https://www.npmjs.com/package/cordova-plugin-ns0m-file-transfer This works!!! trust me!! i have just tried it

I get Invalid Version: null

As @pixellet14 mentioned and posted earlier - this plugin works. I have it loaded and yes, I am able to get it work on both Cordova 11 for both Android@11 and iOS@6.2 (but I have only tested downloads; its all I need it for at the moment) with the following simply function:

  function DownloadFile(urlFile,newFileName,storage_location){
    var fileTransfer = new FileTransfer();
    var folderpath=storage_location+newFileName ; //The path is added here.
    var onSuccess= function(entry){
      console.log("download complete: " + entry.fullPath);
    };

    var onError=function(error) {
      console.log("download error source " + error.source);
      console.log("download error target " + error.target);
      console.log("upload error code " + error.code);
    };

    fileTransfer.download(urlFile,folderpath,onSuccess,onError);
  }  

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants