hazemhagrass / phonegap-base64 Goto Github PK
View Code? Open in Web Editor NEWPlugin to get base64 encoding of any IMAGE, Base64 can be retrieved for any file for android, however for iOS images only supported
Plugin to get base64 encoding of any IMAGE, Base64 can be retrieved for any file for android, however for iOS images only supported
I try to capture audio(file formate .wav) and convert into base64 but this plugin not working in ios.
i found this error while installing this plugin.
Failed to install 'com-badrit-base64': Error: Unhandled "error" event. (The plat
form ".idea" does not appear to be a valid cordova platform. It is missing API.j
s. .idea not supported.)
Hi team,
I'm currently using ionic 3 and i implemented this plugin. it's working perfect on android but when i test it on ios there is an issue.
When i try to encode the image in base64 it just quit my page and nothing happens.
Please help me!!!
Image after encoding is of very low resolution.
whenever i call the method encodeFile() its return Plugin not installed message...
I have Converted Image to Base64 But Output Of the is not working as expected
i'm Unable to decode it Back
No indicative errors are printed but the base64 return value is always an empty string.
The conversion works flawlessly with paths like file:///path/to/file.ext
but not with file:///path/to/file with spaces.ext
there doesn't appear to be any documentation as how this can be done. When sending an image the default is data:image/*;base64
and the *
is causing problems and is really slow. Is there a way to set the default image type upon converting to base64?
The issue is the plugin is trying to write the AndroidManifest.xml at platform/android/AndroidManifest.xml, when the AndroidManifest in newer versions is located at platforms/android/app/src/main/AndroidManifest.xml
I have passed the Base64.encodeFile function the file path returned from the phonega-camera plugin (FILE_URI) at first and it didn't work, Then I saw that the parameter I passed started with "file:///mnt/sd...", so I removed the "file://" from the string so it would be like the example written in the README file, but that didn't work either.
the callback function was called, and the base64 parameter was null.
Doron
No error, returns empty string.
When converting local images to base64 on iOS, the file size becomes triple the original. The image looks the same though.
I'm using Ionic's native camera plugin with CameraOption.destinationType
set to DestinationType.FILE_URI
. Then I convert the image with
this.base64.encodeFile(imagePath).then(base64Image => {
return base64Image;
});
On Android it works as expected and the file size is the same as if I would get the base64 directly from the camera with DestinationType.DATA_URL
. On iOS, my 5.5 MB image becomes 16.2 MB.
I encountered an error when upload to my API. I test with postman and httpie it's working, but when use base64 plugin I got error "Invalid boundary in multipart: None". I already set "Content-Type: multipart/form-data" in ionic post header to my API but still got error.
http --verbose --form POST myapi.com/resources/ [email protected] name=Clark
Here is the output from httpie
POST /api/v0/kajian/ HTTP/1.1
Accept: */*
Accept-Encoding: gzip, deflate
Connection: keep-alive
Content-Length: 79578
Content-Type: multipart/form-data; boundary=3cad93334b304f30b555d85a0cbdb880
Host: myapi.com
User-Agent: HTTPie/0.9.9
Here is the file path i'm passing
"ionic://localhost/_app_file_/var/mobile/Containers/Data/Application/967FEAEF-AC55-4DFF-95FE-E4FBAA06FC2D/tmp/cdv_photo_001.jpg"
Here's the error i'm getting.
"ERROR" { [ng] "line": 25, [ng] "column": 29, [ng] "sourceURL": "http://192.168.25.175:8100/plugins/com-badrit-base64/www/Base64.js" [ng] }
I'm trying to convert from image file_uri to base64 but xcode return an error :
errors encountered while discovering extensions: Error Domain=PlugInKit Code=13 "query cancelled" UserInfo={NSLocalizedDescription=query cancelled}
Installed multiple times.
Hi,
I am using your ionic 2 plugin it works fine to convert images on but when i try to convert a pdf file it does not convert a pdf file please help.
I used media capture plugin and tried to get my media video file path, but the inside result doesn't get anything. Here is my code in below.
const options: CaptureVideoOptions = { duration: 5, quality: 50 };
this.mediaCapture.captureVideo(options).then(
(data: MediaFile[]) => {
let fileName = data[0].fullPath.split('/').pop();
let path = data[0].fullPath.substring(0, data[0].fullPath.lastIndexOf("/") + 1);
console.log('this is path '+path)
let filePath: string = data[0].fullPath;
console.log('full path '+ filePath);
if (this.device.platform == 'Android') {
this.base64.encodeFile(filePath).then((base64File: string) => {
console.log('after convert '+ base64File);
}, (err) => {
console.log('error message ' + err)
})
}
}
);
I have convert audio file in base64 but after that code to decode in php so that is not workable audio file file is correpted
an attempt was made to break through the security policy of the user agent
I want to convert .jpg image to base64 but it is failing to convert.The small size image get converted
Base64 encoded file is working fine in another version but it is not working in android 10.
It works when I work in the camera but not working when I tried to load a file from the gallery
It was working fine until recently, I followed the steps here but the following code does not work.
this.base64.encodeFile(filePath).then((base64File: string) => { console.log(base64File); }, (err) => { console.log(err); });
The above code does not work.
code not executed in IOS
could not working base64.encodeFile
android-minSdkVersion: 22
android-targetSdkVersion: 30
filePath = file:///storage/emulated/0/Download/Small.pdf
this.base64.encodeFile(filePath ).then(async (base64File: string) => {
console.log("==base64File==", base64File)
}, (err) => { });
Got the log "==base64File=="
I'm Using Base64 plugin for saveing the image in gallery. after the use of photoviewer base64 plugin not wokring. It always show the "Photo could not save." messge. I'm using photo viewer for image zoom option. please help me to find the solution.
what is the reason along this side.
It is working fine for android version lower than 7. When i use on android 8 or 9 pdf is not downloaded.When i debug the source i found corrupt base 64 url. Please help as i am working on a project needs to deliver as soon as posible.
Hi. I have the following code:
let filePath: string = 'file:///storage/6E55-1102/DCIM/Camera/20180704_143914.jpg'; this.base64.encodeFile(filePath).then((base64File: string) => { console.log("ssssss" + base64File); }, (err) => { console.log("err"); });
It prints 'sssss' but nothing else. I'm trying to use it for android 6.3.0
What can I do? Thanks.
Hello,
i'm using this plugin but i have a problem. The plugin returns a BASE64 string for an image but if i try to show this image in an img html tag nothing is showed. I have tried also with online tools to show base64 images and i receive this error: "corrupted image".
What i'm wrong?
Thanks.
SecurityError (DOM Exception 18): The operation is insecure
Not work in IOS11
this.base64.encodeFile(this.images[i]) .then( (base64File: string) => { this.loadingImages[i] = false; document.querySelector(
#image${i}).setAttribute('src', base64File) }, (err) => { this.loadingImages[i] = false; this.telocambioService.presentToast('Hubo un error al cargar la imagen, intenta de nuevo.') } )
I am trying convert a image to Base64 in iOS, y I am getting this error:
SecurityError " return canvas.toDataURL();
Hello. Testing on Android to convert a file the Uncaught Reference error is raised on line 11:
I am using PhoneGap Build version 5.2.0
args.filePath = filePath;
//handle android using native code because toDataURL is not supported on android version < 3
if (device.platform == "Android") //Error is raised here
cordova.exec(sucess, failure, "Base64", "encodeFile", [args]);
else{
This is my code:
var url = photos[i][0];
var description = photos[i][1];
window.plugins.Base64.encodeFile(url, function (base64) {
var postData = {
'filex': base64,
'order': theOrder,
'des': description
}
console.log(postData);
$.ajax({
url: apiip + 'pictures',
headers: {
"api-key": apiKey,
"shop-id": shopID
},
type: 'POST',
data: postData,
success: function (data) {
console.log(data);
},
error: function (xhr, status, e) {
console.log(e);
}
});
console.log("sent ajax request");
});
Hi,
I want to upload audio and video too so, I am getting issue of not converting in base64 ,please tell me regarding that.
Regards
Shivam
when i´m trying to convert a video or image of more than 20 mb of size, the app is closed
It works perfectly on android but not on ios
No error but does not return anything.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.