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

replace deprecated cordova-plugin-file-transfer #225

Open
menelike opened this issue Dec 9, 2017 · 3 comments
Open

replace deprecated cordova-plugin-file-transfer #225

menelike opened this issue Dec 9, 2017 · 3 comments

Comments

@menelike
Copy link

menelike commented Dec 9, 2017

As stated on https://cordova.apache.org/blog/2017/10/18/from-filetransfer-to-xhr2.html cordova-plugin-file-transfer has been deprecated. This project shouldn't rely on that plugin as it will cut your project off from further cordova updates.

Binary types in JavaScript, as well as the extended XHR features, are available on the following Cordova-supported platforms without requiring any additional plugins:

Android 4.4 or newer.
iOS 10 or newer.
Windows UWP (8.1, 10 or newer all work).
Windows Phone 8 or newer.
As always, check caniuse.com for detailed support for the required bits, like Blob, Typed Arrays, and extended XHR features.

Since the recommended migration path would cut off older platform versions a major version upgrade might be appropriate.

@chrisben
Copy link
Owner

chrisben commented May 6, 2018

Thanks for the info.

If you stop including the file transfer plugin and replace the FileTransferWrapper function with this one, would it work for you?

  Private.FileTransferWrapper = function (filesystem) {
    if (Helpers.isCordova() && typeof FileTransfer !== 'undefined') {
      console.log('Old cordova-plugin-file-transfer behaviour, please consider not including it anymore');
      this.fileTransfer = new FileTransfer();
    }
    this.filesystem = filesystem;    // only useful for XHR2
};

@tiparrish
Copy link

Thanks for sharing. But can you provide guidance on how to place this in a file. I am getting the following error and now I'm missing something. "Uncaught ReferenceError: Private is not defined" Been trying to get a Phonegap HTML5 app to get access to android device storage. With no success!

@souly1
Copy link

souly1 commented Dec 10, 2020

@chrisben , I've tested it and seems working for both iOS & Android!

Thanks!

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

4 participants