开发者

I am looking to save a canvas as a blob in mySql blob field

the toBlob method of canvas doesn't seem to work for me, so i have used toDataUrl and then sent the data it produces to a controller with ajax, i've then put this data in2 a byte [] to convert it 2 a blob but the data changes from data:i开发者_运维知识库mage/png;base64,iVBORw0KGgoAAAANSUhEU.... like so to an array of numbers [100, 97, 116, 97, 58, 105, 109, 97, 103, 101, 47, 112, 110... like so, when calling the blob back i would like to change the byte [] of numbers back to the original data. is this possible and if so could somebody please give me some advise on how to do it, thanks


Please see what I wrote here on the matter. I'll paste it below for your convenience. The short answer is toBlob is too new to use, and just because something is in the spec doesn't mean its ready.

toBlob() is really new and I would not recommend using it in a consumer app unless you can explicitly ask them to use a particular browser (or else control the environment).

toBlob() Was added on May 12th and is of limited functionality as-defined. It does not exist in the Chrome nightly, firefox nightly, nor IE9.

It is worth noting that Firefox does have a functional mozGetAsFile

There is yet to even be any discussion for adding it to Chrome.

The discussion for Firefox. They have decided to wait until the spec is more clear before they attempt an implementation.

The spec for toBlob() is very vague with a lot of internal questions still unresolved. They aren't even sure what params to allow for typical toBlobl() use yet.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜