Comments (6)
Had any solution?
from phonegap-base64.
Plugin no response on iOS 12.4.1 @ ionic 3.
from phonegap-base64.
BASE 64 not working in IOS device, below code is working for me i used Ionic file plugin
this.file.readAsDataURL(path, fileName).then(imgURL => {
alert(imgURL);
console.log(imgURL + 'test 2') ;
})
from phonegap-base64.
I spent many hours on this finally i got the solution for IOS ionic base 64 encoding. follow the below steps.
fileSavedPath: file:///Users/admin/Library/Developer/CoreSimulator/Devices/14915871-D5BD-4631-8618-39714211D8BA/data/Containers/Data/Application/D3EB751F-1989-493B-A166-3481D0B2C88D/Documents/record24920191802.m4a'
this.filePath = this.file.documentsDirectory + fileSavedPath;
let fileName = this.filePath.split('/').pop();
let path = this.filePath.substring(0, this.filePath.lastIndexOf("/") + 1);
this.file.readAsDataURL(path,fileName).then((data)=>{
console.log(data);
alert(data)
});
from phonegap-base64.
For me also not supported used below code.
this.filePath = this.file.documentsDirectory + fileSavedPath;
let fileName = this.filePath.split('/').pop();
let path = this.filePath.substring(0, this.filePath.lastIndexOf("/") + 1);
this.file.readAsDataURL(path,fileName).then((data)=>{
console.log(data);
alert(data)
});
from phonegap-base64.
@bluecloudRaj I have been pulling my hair out for a day and a half trying to figure out WHY the base64 from an Android device is being correctly sent, however, with iOS it was somehow being corrupted or not sent correctly. If you use the WebView plugin for Ionic then you can get the Base64 string however, it is not encoded correctly.
this is how I accomplished it using the camera plugin
try {
const fileData: string = await this.camera.getPicture(options);
const path: string = fileData.substring(0, fileData.lastIndexOf('/') + 1);
const fileName: string = fileData.split('/').pop();
const b64: string = await this.file.readAsDataURL(path, fileName);
const mp4Encoded: string = b64.replace('quicktime', 'mp4');
} catch (err) {
alert(JSON.stringify(err));
}
note that the above was for a video taken from an iOS that will be able to be seen by Android/iOS
from phonegap-base64.
Related Issues (20)
- Issue on IOs
- for Cordova 8.0,0, it does not install HOT 1
- SecurityError: The operation is insecure HOT 1
- I am not receiving the base64 HOT 5
- unable to install the plugin
- Image more than 3MB is not converted...
- Base64 Code Is not Properly Encoded HOT 4
- Audio file not convert properly in base64 HOT 1
- Plugin not working in ios HOT 4
- Image resolution becomes very low
- configure encoding type? HOT 2
- plugin not working on ios
- Paths that contain spaces cause conversion problems. HOT 2
- Corrupt pdf base64 URL for android version > 7.0
- Ionic3 cordova Base64 encodeFile not working in android 10 HOT 6
- Base64plugin not working after Installing the photoviewer plugin installed.
- Ionic convert mp4 file to base64, and I get empty result from console.log HOT 1
- files of more than 20 mb crash the app
- Return empty string in Android 11 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from phonegap-base64.