简体   繁体   English

Phonegap不返回base64编码的数据

[英]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.

相关问题 android:将图像上传到服务器,base64encoded或multipart / form-data? - android :uploading image to server , base64encoded or multipart/form-data? 将base64encoded映像保存为服务器端数据库BLOB - Save base64encoded image to server-side database as BLOB Sencha Touch 2 + PhoneGap + iPad:带有base64编码数据的视频:“操作无法完成” - Sencha Touch 2 + PhoneGap + iPad: Video with base64 encoded data: “The Operation could not be completed” 使用json数据发送imageview base64编码的字符串 - Send imageview base64 encoded string using json data Android下载Base64编码的数据,对其进行解码并将其保存到文件 - Android Download Base64 Encoded data, decode it and save it to file 通过Android通过USSD发送Base64编码的数据 - Send Base64 encoded data over USSD from Android 给定无效的 base64 编码字符串,如何使 Android Base64.decode 可靠抛出异常(或返回 null)? - How to make Android Base64.decode reliable throws exception (Or returning null) given an invalid base64 encoded string? 通过Retrofit2返回空响应上传Base64编码图像 - Upload an Base64 Encoded Image through retrofit2 returning null responce 如何部分从Web服务器下载Base64数据并部分从编码数据解码? - How to download Base64 data partly from web server and decode partly from encoded data? 无法显示Base64编码的图像 - Unable to display Base64 encoded Image
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM