如何在数据库中存储一个Jpeg文件? [英] how to store a Jpeg file in a database?

查看:149
本文介绍了如何在数据库中存储一个Jpeg文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以使用Web应用程序将Jpeg文件存储在数据库中?

Is it possible to store a Jpeg file in a database using a Web Application?

您可以共享一些有关如何执行此操作的代码吗?

can you share some code on how to do it?

或分享一些链接一些教程与我的问题?非常感谢:)

or share some links for some tutorial regarding with my problem? thanks a lot :)

推荐答案

在blob中存储图片

我不使用java,i不知道你正在使用什么数据库结构,但原理是将图像存储在二进制大对象中。 (blob),它需要使用流读取对象进出。 (或至少在c#中是这种情况)

i don't use java, i don't know what database structure you are using but the principle is to store the image in a binary large object. (blob) it does require reading the object in and out using streams. (or at least in c# this is the case)

替代方法(如果它工作)是存储字符串位置,并将图像放在某个目录中的某个目录。

the alternative(if it works) is to store a string location and have the image in a directory somewhere.

这篇关于如何在数据库中存储一个Jpeg文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆