Im trying to save a canvas div and then upload it to the server but i cant manage to make it work.
so, this what i do:
- i create a canvas div where i will paint with paperjs
- i save that canvas div (dataToURL method)
- i try to upload it, but i doesn’t work.
this is the web:
http://www.davidpenuela.com
I tested uploading an image to my server with jquery file uploader (test jquery uploader) and that script works, but i can make it work when saving from my canvas.
canvas2image is not working for me, it doesnt upload anything.
EDIT:
manage to make it work, I will post the way of doing it soon.
Thanks!
You can’t get it it work because it is not a file upload. File uploads use encoded form data with a
multipart/form-datacontent type. You client code is posting data that is not form encoded and has acanvas/uploadcontent-type. You need to update your server code to make it aware of the ‘canvas/upload’ content type, or find a way to form encode the image before upload.