admin管理员组文章数量:1394778
i need to create a ponent using html5 canvas that given an image the user can paint on it and directly (via a kind of save button) upload it's customized version on the server.
Can i use html canvas for it ? Any suggestion ?
thx in advance
i need to create a ponent using html5 canvas that given an image the user can paint on it and directly (via a kind of save button) upload it's customized version on the server.
Can i use html canvas for it ? Any suggestion ?
thx in advance
Share Improve this question asked Sep 10, 2010 at 11:49 GiulianoGroGiulianoGro 711 silver badge2 bronze badges 1- Related: Draw image on canvas from image data stored in database – ggorlen Commented Dec 4, 2023 at 19:37
2 Answers
Reset to default 6You can get the image as data-url like this:
var dataUrl = document.getElementById('your-canvas').toDataURL();
You could then send this (very long string) to the server and save it to a file after decoding it (it is encoded in base64).
EDIT: Remember to submit this via POST
, as suggested in the ments. GET
has some length-limits in various browsers, so its likely to exceed those limits with such a huge amout of data.
Note that this is currently dead-on-arrival for Android (up to and including 2.3). Please star this issue - http://code.google./p/android/issues/detail?id=7901
本文标签: javascriptHTML5 save canvas to file on serverStack Overflow
版权声明:本文标题:javascript - HTML5 save canvas to file on server - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744102432a2590928.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论