![](/img/trans.png)
[英]How to display or preview a uploaded image after submitted in PHP without save to database?
[英]How to save and display image into database without using move uploaded or copy functions in php
如何在不使用php中的移动上载或复制功能的情况下将图像保存并显示到数据库中? 是否可以做到这一点而无需将图像保存到目录中并将其保存到具有该特定字段的某种数据类型的数据库中?
使用blob数据类型是将图像直接保存在数据库中。
这是PHP MySQL BLOB的一个示例。希望它对您有所帮助。
也许您可以尝试获取base64编码的映像并将其保存到数据库中。
$image_as_string = base64_encode( file_get_contents( 'image.jpg' ) )
// now save dat string to your database.
希望能帮助到你。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.