I have an base64 picture string in coldfusion.
How can I save this image blob into the database without storing to filedisk?
My function.
<cfset base64string="base64picturestring">
<cfimage source="#ImageReadBase64("data:image/png;base64,#base64string#")#"
destination="c:\picture.png" action="write" overwrite="true">
<cffile action="readbinary" file="c:\picture.png" variable="ImageData"/>
INSERT INTO imagedb (imageblob)
VALUES (<cfqueryparam cfsqltype="cf_sql_blob" value="#ImageData#" />)
But I don’t want to save image on the hard drive.
I need this.
base64—-imageblob—-database
Any help?
You could use the in-memory filesystem:
http://help.adobe.com/en_US/ColdFusion/9.0/Developing/WSe9cbe5cf462523a0-70e2363b121825b20e7-8000.html#WSe9cbe5cf462523a0-540771bc12182683461-8000