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

java - Solr query version issue: Invalid version or the data in not in 'javabin' format -

Hard vs. Soft Water: What's The Difference?

The Ten Most Livable Cities In The World