开发者

how to store a Jpeg file in a database?

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 t开发者_开发百科utorial regarding with my problem? thanks a lot :)


storing an image in a blob

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.


BLOB data type, that is what u need.

and the link is ;)

blob google search


This is not a good practice to store a jpeg file in database. Always store the file in related directories and store their paths in your database. If you are storing jpeg files in your database, then think about the size of your database if you are having 1 million records?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜