将blob图片保存到数据库而不存储到高清
我在 Coldfusion 中有一个 Base64 图片字符串。
如何将此图像 blob 保存到数据库中而不存储到文件磁盘? 我的职能。
<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#" />)
但我不想将图像保存在硬盘上。 我需要这个。
base64----imageblob----database
有帮助吗?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以使用内存中的文件系统:
http://help.adobe.com/en_US/ColdFusion/9.0/Developing/WSe9cbe5cf462523a0-70e2363b121825b20e7-8000.html#WSe9cbe5cf462523a0-540771bc12182683461-8000
You could use the in-memory filesystem:
http://help.adobe.com/en_US/ColdFusion/9.0/Developing/WSe9cbe5cf462523a0-70e2363b121825b20e7-8000.html#WSe9cbe5cf462523a0-540771bc12182683461-8000
计算 Base64 编码数据的二进制表示
Calculates the binary representation of Base64-encoded data