how to store a Jpeg file in a database?

那年仲夏 提交于 2019-12-25 07:49:12

问题


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 :)


回答1:


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.




回答2:


BLOB data type, that is what u need.

and the link is ;)

blob google search




回答3:


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?



来源:https://stackoverflow.com/questions/5217180/how-to-store-a-jpeg-file-in-a-database

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!