[英]Phonegap not returning base64encoded data
I am using Phonegap and the camera application. 我正在使用Phonegap和相机应用程序。 I want to obtain a base64 encoded string. 我想获得一个base64编码的字符串。 but can't get it to work. 但无法正常工作。 I am always getting a system path of the image. 我总是得到图像的系统路径。 I need to retrieve the string. 我需要检索字符串。
function clickPhoto()
{
navigator.camera.getPicture(onPhotoDataSuccess, onFail,
{
quality: 25,
destinationType: destinationType.FILE_URI
});
}
I need to know how to get the base64 encoded string. 我需要知道如何获取base64编码的字符串。 I read somewhere on stack that the default of phonegap now returns file path. 我在堆栈上的某个地方读到,默认的phonegap现在返回文件路径。 I need a base64. 我需要一个base64。
Please suggest. 请提出建议。
Use this : 用这个 :
navigator.camera.getPicture(onPhotoDataSuccess, onFail, { quality: 50,
destinationType: destinationType.DATA_URL });
Thanks. 谢谢。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.