FineUploader / server-examples

Server-side examples for the Fine Uploader library
https://fineuploader.com
MIT License
279 stars 204 forks source link

How to add a canvas to fineuploader #55

Closed jag678 closed 8 years ago

jag678 commented 8 years ago

` onSubmit:function(id,file) { image = this.getFile(id) var fr = new FileReader(); var canvas = document.createElement("canvas"); fr.onload = function() { img = new Image(); img.onload = function(){ canvas.width = img.width; canvas.height = img.height; canvas.getContext("2d").drawImage(img,0,0); } img.src = fr.result; } // onload fires after reading is complete fr.readAsDataURL(image);

                    }

Now ,how can I add this canvas to fineuploader?I found about the addFile() method but couldn't find a proper way? This is my fineuploader js-> $('#fineuploader').fineUploaderS3({

            signature:{
                endpoint:"{%url 's3_signee' %}",
            },

            uploadSuccess:{
                endpoint: "{%url 's3_succes_endpoint' %}"

            },
            validation: {
                 allowedExtensions: ["gif", "jpeg", "jpg", "png"],
                acceptFiles: "image/gif, image/jpeg, image/png",
                 sizeLimit: 50000000,
             },
             callbacks:{
               onSubmit:function(id,name){
              as `above//`
            }

})

rnicholus commented 8 years ago

Http://FineUploader.com/support