tsayen / dom-to-image

Generates an image from a DOM node using HTML5 canvas
Other
10.28k stars 1.68k forks source link

How to save on php side by ajax? #260

Open oscarhandsome opened 5 years ago

oscarhandsome commented 5 years ago

Hello all! thank you, @tsayen , for your best work! About my issue. Will try to explain. I created small application link testing here i used code from another application from another developer from this site

all code js here All code is written not by me. but i'm trying to fix everywhere what we need.

I can't correctly convert to base64 with blob to save on the PHP side. But this is not for this chat.

How to do it correctly, can somebody give examples? my bottleneck here is this part of code: window.uploadPicture = function (callback) { croppie.result({ size: "viewport" }).then(function (dataURI) { var formData = new FormData(); formData.append("design", $("#fg").data("design")); formData.append("image", dataURItoBlob(dataURI)); $.ajax({

when i'm trying to change dataURI to dataURI from domtoimage script I have the issue, and can't understand how to resolve it...