3

I have a canvas that I am saving to a DataURL, and I could right click it and save it as an image to my files, but how do I convert it to an image either on the client-side or server-side(Rails) for the purpose of posting it to Facebook (with the Koala Gem)

If I try just putting the dataURL straight to Facebook, I get this error:

Invalid arguments to initialize an UploadableIO

I am getting the DataURL to the server-side by doing this:

  stage.toDataURL({
callback: function(dataUrl) {
    $("#hidden").html('<input id="image" name="image" type="hidden" value="' + dataUrl + '">')
}
});

Anyway, it seems that Facebook's api will not accept a DataURL, so how would I go about making this into an image file and then sending it off?

4

1 に答える 1