javascript - send image to server by passing datURL generated from canvas -


i tried save canvas image '~/image/upload' folder in application. error: failed load resource: server responded status of 405 (method not allowed). doing wrong here?

var dataurl = canvas.todataurl(); $.ajax({ type: "post", url: "image/upload", data: {          imgbase64: dataurl     } }).done(function(o) {    console.log('saved');                                                                      }); 

probably url need escaped

var dataurl = encodeuricomponent(canvas.todataurl()); 

Comments

Popular posts from this blog

OpenCV OpenCL: Convert Mat to Bitmap in JNI Layer for Android -

android - org.xmlpull.v1.XmlPullParserException: expected: START_TAG {http://schemas.xmlsoap.org/soap/envelope/}Envelope -

python - How to remove the Xframe Options header in django? -