cordova-plugin-file-transfer | Apache Cordova Plugin file-transfer | Mobile Application library
kandi X-RAY | cordova-plugin-file-transfer Summary
kandi X-RAY | cordova-plugin-file-transfer Summary
This plugin allows you to upload and download files. This plugin defines global FileTransfer, FileUploadOptions constructors. Although in the global scope, they are not available until after the deviceready event. To get a few ideas, check out the sample at the bottom of this page. Report issues with this plugin on the Apache Cordova issue tracker.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Convert a path to a native path
cordova-plugin-file-transfer Key Features
cordova-plugin-file-transfer Examples and Code Snippets
Community Discussions
Trending Discussions on cordova-plugin-file-transfer
QUESTION
I upgraded angular to angular 13 and cannot get my project to build or serve. It appears that Angular isn't recognizing any of my ionic tags in the .html files. What am I missing?
I am able to run npm install without issues. I have deleted the node_modules and package-lock.json files, removed the platform and then run npm install and added the platform back. That is successful, but running ionic serve or ionic cordova build android results in a whole stream of errors that looks like angular isn't seeing the ionic html tags and there are new errors with Promises and more.
This is what I get when I run Ionic info:
my package.json....
...ANSWER
Answered 2022-Mar-23 at 17:38Figured out what the issue was. MicrosoftSDK had TypeScript 3.1 and first when running "where tsc". I moved the npm directory up in the Environmental Variables. Then I removed Angular and reinstalled it.
QUESTION
Right after the splash screen fades out, the app is stuck on a blank page leaving this error in the console (ProxyWeb::didFailProvisionalLoadForFrame)
Note that the same app works perfectly on all previous IOS versions. I tried to change the webview plugin version, cordova-ios, and played around with angular build process but no luck.
I suspect that the angular portion of the project does not initialize, cordova itself loads successfully but anything beyond that is just an empty blank screen.
...ANSWER
Answered 2021-Sep-24 at 12:03Problem solved by a colleague, turned out a few providers (DatePipe, Location, Market, InAppBrowser) in app.component.ts
and a router animation were causing the fuss.
QUESTION
I'm trying to generate a bundle for iOS but pods throw me this error. I'm 95% sure that it's a problem with plugins but I can't solve.
I tried to reinstall pods, recreate capacitor ios. I'm doing it on mac, with new m1's
✔ Updating Android plugins in 25.89ms
Found 2 Capacitor plugins for android: @capacitor-community/keep-awake (1.0.0) capacitor-keep-screen-on (1.0.0-alpha.6) Found 6 Cordova plugins for android cc.fovea.cordova.purchase (10.1.1) cordova-plugin-device (2.0.3) cordova-plugin-file (6.0.2) cordova-plugin-file-transfer (1.7.1) cordova-plugin-ionic (5.4.7) cordova-plugin-whitelist (1.3.4) enter code here
✔ update android in 65.89ms
✔ Updating iOS plugins in 8.94ms Found 2 Capacitor plugins for ios: @capacitor-community/keep-awake (1.0.0) capacitor-keep-screen-on (1.0.0-alpha.6) Found 5 Cordova plugins for ios cc.fovea.cordova.purchase (10.1.1) cordova-plugin-device (2.0.3) cordova-plugin-file (6.0.2) cordova-plugin-file-transfer (1.7.1) cordova-plugin-ionic (5.4.7) ⠋ Updating iOS native dependencies with "pod i⠙ Updating iOS native dependencies with "pod i⠹ Updating iOS native dependencies with "pod i⠸ Updating iOS native dependencies with "pod i⠼ Updating iOS native dependencies with "pod i⠴ Updating iOS native dependencies with "pod i⠦ Updating iOS native dependencies with "pod i⠧ Updating iOS native dependencies with "pod i⠇ Updating iOS native dependencies with "pod i⠏ Updating iOS native dependencies with "pod i
✖ Updating iOS native dependencies with "pod install" (may take several minutes):
✖ update ios: [error] Analyzing dependencies
――― MARKDOWN TEMPLATE ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――
Command ...ANSWER
Answered 2021-Jan-22 at 14:28The ffi gem doesnt seem to support the M1 chip yet.
Uninstall cocoapods from brew and then try running the terminal in rosetta mode. Right click terminal, get info run in rosetta. Then install the ffi gem from there by typing:
QUESTION
I am working on a Cordova application.
When I run the application for first time after installation, it works fine. But for subsequent runs it throws above error.
...Added the cordova file transfer plugin
ANSWER
Answered 2020-Dec-22 at 13:31My issue fixed when I used the "file:///android_asset/www/Images/" instead of
cordova.file.applicationDirectory+"/Images"
QUESTION
I have recently migrated the app from ionic 4 to 5 - Angular 7 to 9. Made all the migration specific changes to config & code. Ionic serve works well. Also no error while creating a production build. But app is not getting loaded! Also used service worker in application.
followed the migration guidelines provided by Ionic & Angular
Package.json -->
...ANSWER
Answered 2020-Oct-26 at 12:10After lot of analysis, I got this resolved by making buildOptimizer flag as false.
Make sure in angular.json setting -->
QUESTION
I am trying for 3 days to get a video playback for cordova-ios 5.1.1 on Cordova 9 to work.
What is this app supposed do in short?
A video gets download to the device storage and should be playable from that device as an offline video player.
There were several problems I had to sort out first:
Stuck at Cordova 9 due to 'cordova-plugin-file-transfer' which is not yet compatible with Cordova 10 --> https://github.com/apache/cordova-plugin-file-transfer/issues/258
Unable to go with Cordova 10 yet, because suggested ways to download huge files on Cordova 10 gets the memory exhausted on the device, as the data is loaded to memory completly first
using cdvfile:// schema to open a local video for gives me a timeout, the video does not start
using a local server plugin did not work for me either
I really tried a lot of configurations and code to get this to work and spent a lot of time at git trying to figure out what I might be missing.
These are the plugins I tried for a working concept of an offline video player:
https://github.com/apache/cordova-plugin-wkwebview-engine
https://github.com/oracle/cordova-plugin-wkwebview-file-xhr
https://github.com/TheMattRay/cordova-plugin-wkwebviewxhrfix
https://github.com/floatinghotpot/cordova-httpd
https://github.com/communico/cordova-httpd
https://github.com/nchutchind/cordova-plugin-streaming-media
This is my content security policy:
...ANSWER
Answered 2020-Aug-14 at 15:52I was able to solve the issue. Here is a solution that worked for me for all people that might have trouble with this.
Basically I had a configuration error and some filename/filepath issues with this.
I can confirm the upper concept works with this platform and plugins:
QUESTION
Have an Ionic 3 app, that gets stuck on splash screen when I'm emulating on iOS. Funny thing, if I add a space to a ts file, it refreshes and starts working.
This is messing up my E2E testing with Appium, so I'm wondering if anyone has a better idea of what might be causing this behaviour.
I'm leaving here all package.json dependencies, in case that helps:
...ANSWER
Answered 2020-Aug-28 at 09:59Clean and rebuild
QUESTION
I am able to successfully build and run my app in ios5, but when I upgrade to ios6.1.0 in order to install a plugin that will allow me to use VKwebview and reference local html files, I get 3 fatal errors in xcode:
- Property 'userAgent' not found on object of type 'CDVViewController *'
- Use of undeclared identifier 'CDVUserAgentUtil'. (these are repeated twice)
I am at a total loss as to even start looking for the answers.
This is my config.xml:
...ANSWER
Answered 2020-Jul-27 at 07:15CDVUserAgentUtil
has been removed in cordova-ios@6
which is a breaking change (hence the major version increment in cordova-ios
to 6
).
This class is used by some Cordova plugins in your project hence the error.
You should first update all of your plugins to the latest versions so those which have been updated to removed references to CDVUserAgentUtil
are used.
At least one of your plugins - cordova-plugin-file-transfer is deprecated and contains an implicit reference to CDVUserAgentUtil
. In this case you could use my fork of this plugin which has been fixed to remove the reference:
QUESTION
I have some issue with ionic CORS on an iOS device. Now, I know that CORS issue should be solved mainly from the server. As I have fool control over the backend I set the following headers on the Apache Vhosts file.
...ANSWER
Answered 2020-Jul-25 at 16:32After spending several hours on debugging, I found out that the issue was that it doesn't accept wildcard for Access-Control-Allow-Methods and Access-Control-Allow-Headers So the server headers look like this now.
QUESTION
I've applied the config.xml updates they reccommend, but I'm still getting a reject message from Apple for using the UIWebView. Any suggestions?
I have iOS 5.1.1 and CLI 9.0.1
cordova-background-geolocation-lt 3.0.8 "BackgroundGeolocation" cordova-launch-review 3.1.1 "Launch Review" cordova-plugin-background-fetch 5.5.0 "CDVBackgroundFetch" cordova-plugin-calendar 5.1.5 "Calendar" cordova-plugin-camera 4.1.0 "Camera" cordova-plugin-cocoalumberjack 0.0.4 "CocoaLumberjack" cordova-plugin-contacts 3.0.1 "Contacts" cordova-plugin-device 2.0.3 "Device" cordova-plugin-file 6.0.1 "File" cordova-plugin-file-transfer 1.7.1 "File Transfer" cordova-plugin-geolocation 4.0.2 "Geolocation" cordova-plugin-globalization 1.11.0 "Globalization" cordova-plugin-inappbrowser 3.2.0 "InAppBrowser" cordova-plugin-whitelist 1.3.4 "Whitelist" cordova-plugin-wkwebview-engine 1.2.1 "Cordova WKWebView Engine"
...ANSWER
Answered 2020-May-02 at 01:21I was able to get by it, there was some references in readme files that had the text UIWebView in it. I just deleted them.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install cordova-plugin-file-transfer
target: Filesystem url representing the file on the device. For backwards compatibility, this can also be the full path of the file on the device. (See Backwards Compatibility Notes below)
successCallback: A callback that is passed a FileEntry object. (Function)
errorCallback: A callback that executes if an error occurs when retrieving the FileEntry. Invoked with a FileTransferError object. (Function)
trustAllHosts: Optional parameter, defaults to false. If set to true, it accepts all security certificates. Not recommended for production use. Supported on iOS. (boolean)
options: Optional parameters, currently only supports headers (such as Authorization (Basic Authentication), etc).
Use the File-Transfer plugin to upload and download files. In these examples, we demonstrate several tasks like:.
Downloading a binary file to the application cache
Uploading a file created in your application's root
Downloading the uploaded file
Use the File plugin with the File-Transfer plugin to provide a target for the files that you download (the target must be a FileEntry object). Before you download the file, create a DirectoryEntry object by using resolveLocalFileSystemURL and calling fs.root in the success callback. Use the getFile method of DirectoryEntry to create the target file. Note For persistent storage, pass LocalFileSystem.PERSISTENT to requestFileSystem. When you have the FileEntry object, download the file using the download method of the FileTransfer object. The 3rd argument to the download function of FileTransfer is the success callback, which you can use to call the app's readBinaryFile function. In this code example, the entry variable is a new FileEntry object that receives the result of the download operation. If you just need to display the image, take the FileEntry to call its toURL() function. Depending on your app requirements, you may want to read the file. To support operations with binary files, FileReader supports two methods, readAsBinaryString and readAsArrayBuffer. In this example, use readAsArrayBuffer and pass the FileEntry object to the method. Once you read the file successfully, construct a Blob object using the result of the read. Once you read the file successfully, you can create a DOM URL string using createObjectURL, and then display the image. As you saw previously, you can call FileEntry.toURL() instead to just display the downloaded image (skip the file read).
To download the image you just uploaded, you will need a valid URL that can handle the request, for example, http://some.server.com/download.php. Again, the success handler for the FileTransfer.download method receives a FileEntry object. The main difference here from previous examples is that we call FileReader.readAsText to read the result of the download operation, because we uploaded a file with text content. In the readFile function, call the readAsText method of the FileReader object.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page