是否可以在MYSQL数据库中存储图像文件(.jpg,.gif等)?或者只是在系统中存储并获取图像的参考路径?

我正在使用ASP.NET C#,所以如果你有示例代码,那么如果你可以分享它会很棒.

最佳答案
是的,您可以将图像文件(和任何其他文件)作为二进制数据存储在数据库中.

在MySQL中,BLOB data type可用于实现此目的.

A BLOB is a binary large object that can hold a variable amount of data. The four BLOB types are TINYBLOB,BLOB,MEDIUMBLOB,and LONGBLOB. These differ only in the maximum length of the values they can hold. […]

BLOB values are treated as binary strings (byte strings). They have no character set,and sorting and comparison are based on the numeric values of the bytes in column values.

dawei

【声明】:丽水站长网内容转载自互联网,其相关言论仅代表作者个人观点绝非权威,不代表本站立场。如您发现内容存在版权问题,请提交相关链接至邮箱:bqsm@foxmail.com,我们将及时予以处理。