Reputation: 29576
I have HTML5 canvas where the user has created an image. This is for an image drawing program. I now need to grab the canvas and post it to my server. I also need to post a set of key/value pairs along with the image. Could someone help me with how this is supposed to be done?
Upvotes: 1
Views: 258
Reputation: 116000
See Capture HTML Canvas as gif/jpg/png/pdf? for how to use toDataURL
to turn your canvas into an image (encoded as a data URL) .
Consult the MDN Ajax tutorial to learn how to send data to your server asynchronously.
Upvotes: 1