* Current situation:
I have an app that will take a picture, this picture becomes base64 string. So I have a something like this:
data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAzwAAAO9CAYAAABHGmKTAAAACXBIWXMAAA9hAA
I Have the following code, that actually works with the link of an image.
var picture = 'http://tonsofcats.com/wp-content/uploads/2013/08/d6040e929550e65fcf1aacbbf0f58e5f-550x411.jpg';
client.messages.create({
to: "+6548554654645",
from: "+14654561878",
body: "Testing - Testing - Testing - Testing",
mediaUrl: picture
}, function(err, message) {
console.log(message.sid);
});
All of this code, works perfectly. But now I need to send an image that is a base64 string.
Is there a way I can send the image? Like decode it, or save it in cache to be able to send it?
When I try to send the encoded base64 string instead of the URL, I get this error.
Decided to change up a bit the code to see what error I am getting: Found the following:
So, I see that it's a JSON problem, when is trying to send a huge string encoded image
UPDATE
When I console.log(message). This is the message that I get: