Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Storing and Retrieving Image Data URL

Is it possible to store 'Data URL' extracted from a canvas by toDataURL("image/png"); in a database and reconstruct the image by retrieving this 'Data URL'? I have tried to store the 'data URL' to a BLOB.

like image 531
Sudhakar Pandey Avatar asked Oct 31 '22 03:10

Sudhakar Pandey


1 Answers

toDataURL("image/png") method returns a data URI only. You can store that to sql database easily and the same can be retrieved and used to construct the image. You will have to set the src of the image with the retrieved data URI. Please refer this one also, this should give you an idea.

like image 138
Debajit Majumder Avatar answered Nov 15 '22 06:11

Debajit Majumder