cordova-plugin-file

EncodingError when cordova-plugin-file

∥☆過路亽.° 提交于 2019-12-13 11:35:14
问题 I am now developing a cordova app which platform is browser. I need to access a text file from local file system, so I am using the cordova-plugin-file. But I failed as the exception in my chrome console like this (There is no CLI error): code: 5 message: "A URI supplied to the API was malformed, or the resulting Data URL has exceeded the URL length limitations for Data URLs." name: "EncodingError" as my code blow: document.addEventListener('deviceready', dataRead, false); function dataRead()

filePluginIsReady event is never fired in chrome when using cordova-plugin-file

我怕爱的太早我们不能终老 提交于 2019-12-10 18:37:10
问题 I am now developing a cordova app whitch platform is browser(Chrome). I failed when using the cordova-plugin-file to read a file. According to the document of cordova-plugin-file : Chrome quirks, It said that: Chrome filesystem is not immediately ready after device ready event. As a workaround you can subscribe to filePluginIsReady event....You can use window.isFilePluginReadyRaised function to check whether event was already raised. I wrote my code like this : document.addEventListener(

Can't use cordova-plugin-file in Chrome : SecurityError when calling window.resolveLocalFileSystemURL

女生的网名这么多〃 提交于 2019-12-10 13:24:11
问题 I use latest cordova with browser platform (I do know it is some quite experimental). I need to read and write in the cordova.file.dataDirectory directory. filePluginIsReady event is correctly fired in Chrome, and I put my read/write action in its callback. I use cordova-plugin-file (latest), working great with Firefox and Internet Explorer 11, but with Google Chrome, calling window.resolveLocalFileSystemURL always raise this FileError : code: 2 message: "It was determined that certain files

How to move file to app directory using Cordova

那年仲夏 提交于 2019-12-07 23:25:15
问题 How can I move the image captured from my phone camera to the Cordova app directory? I want to move the file to, ideally with mkdir like function for new directories app/www/uploads/new The image location of the file is saved in a var: imagePath = file://emu/0/android/cache/something.jpg Any help is welcomed. I am using Cordova version 4.1.2 and installed the Cordova File Plugin. 回答1: I do think that the app/www directory is read-only since it contains your actual code and is packaged as .apk

How to move file to app directory using Cordova

可紊 提交于 2019-12-06 12:27:32
How can I move the image captured from my phone camera to the Cordova app directory? I want to move the file to, ideally with mkdir like function for new directories app/www/uploads/new The image location of the file is saved in a var: imagePath = file://emu/0/android/cache/something.jpg Any help is welcomed. I am using Cordova version 4.1.2 and installed the Cordova File Plugin. Roope Hakulinen I do think that the app/www directory is read-only since it contains your actual code and is packaged as .apk . Why would you need it there though? It is still since it is on disk. If you want to copy

Ionic 3 get base64 audio string from recorded file

可紊 提交于 2019-12-02 17:28:14
问题 I am using cordova-plugin-media to record voice(with pause and resume features) in my ionic app for android. After I record it I need to get base64 string in order to play it using html audio tag. And the problem is: if I am trying to save recording which was paused and resumed as 3gp file('voice.3gp'), then when I use readAsDataURL method of cordova-plugin-file, I don't receive anything(the callback simply not called). If I am trying to save it as mp3 or wav file, then I receive only 1st

Ionic 3 get base64 audio string from recorded file

不想你离开。 提交于 2019-12-02 10:44:16
I am using cordova-plugin-media to record voice(with pause and resume features) in my ionic app for android. After I record it I need to get base64 string in order to play it using html audio tag. And the problem is: if I am trying to save recording which was paused and resumed as 3gp file('voice.3gp'), then when I use readAsDataURL method of cordova-plugin-file , I don't receive anything(the callback simply not called). If I am trying to save it as mp3 or wav file, then I receive only 1st part of the recording(before pause). I suppose that the proper audio file extension should be 3gp as this

Why is my IOS app rejecting cdvfile:// and file:/// links?

試著忘記壹切 提交于 2019-12-01 17:27:31
I'm having a problem displaying images downloaded to cordova.file.dataDirectory in my angular/ionic/cordova app. I'm using cordova-plugin-file and I'm able to download the files, and extract the URLS using .toInternalURL() and/or .toURL(). However the angular list view is rejecting them. I'm using WkWebView for Ios, and my code is working fine on Android (using .toInternalURL() ). I've whitelisted both cdvfile://* and file:///* in the config and in the meta content-security-policy... I've added screenshots Here's the console screenshot for links generated by .toInternalURL() Here's the

Why is my IOS app rejecting cdvfile:// and file:/// links?

烈酒焚心 提交于 2019-12-01 16:21:04
问题 I'm having a problem displaying images downloaded to cordova.file.dataDirectory in my angular/ionic/cordova app. I'm using cordova-plugin-file and I'm able to download the files, and extract the URLS using .toInternalURL() and/or .toURL(). However the angular list view is rejecting them. I'm using WkWebView for Ios, and my code is working fine on Android (using .toInternalURL() ). I've whitelisted both cdvfile://* and file:///* in the config and in the meta content-security-policy... I've