Foliotek / Croppie

A Javascript Image Cropper
http://foliotek.github.io/Croppie
MIT License
2.56k stars 884 forks source link

Croppie + PHP #428

Open juscelinobarao opened 6 years ago

juscelinobarao commented 6 years ago

I have an image cropping code made by the Croppie plugin, but I can not send the image through php to a certain folder. Can someone with more experience in jQuery help me with my code?

Project in: https://codepen.io/pen/qVyoYq

rakeshaspl commented 6 years ago

404 for above URL.

aradhell commented 6 years ago

You can use like this,

$uploadCrop = $('#my-imagex').croppie({
              viewport: {
                  width: 300,
                  height: 300
              },
              enableExif: true
          });
$uploadCrop.croppie('result', {
                  type: 'base64',
                  size: 'viewport',
                  format: 'jpeg'
              }).then(function (resp) {
                  console.log("base64 : "+resp);
                  $.post("/ajax/requests.php?request=uploadPicture", {blob: resp},
                      function(data, status){
                          var response = jQuery.parseJSON(data);
                          if(response.success == 1) {

                          } else {
                              alert(data);
                          }

                      });
              });
rakeshaspl commented 6 years ago

Can you check this issue https://github.com/Foliotek/Croppie/issues/431 ?

thedustinsmith commented 6 years ago

@juscelinobarao were you able to figure out your issue?