我应该存储我的图片在数据库或文件夹? [英] Should I store my images in the database or folders?

查看:155
本文介绍了我应该存储我的图片在数据库或文件夹?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

可能重复:结果
  存储DB图片 - 是啊,还是不是

目前各公司在我的网站拥有1张,他们可以添加到他们的个人资料。
我保存图片到数据库....其公司标志。

At the moment each Company on my website have 1 picture they can add to their profile. I save that image into the database....its their Company Logo.

现在我希望让他们增加更多的图片。现在我不知道如果我必须将其全部保存在数据库或将其保存在文件夹????

Now i want to allow them to add more pictures. Now i don’t know if i must save it all in the database or save it in folders????

我之所以认为文件夹会更好是因为有花哨的银色光这么多漂亮的文章还挺功能,我可以使用,但他们都只是迎合保存在文件夹中的图像。

Reason why i think folders will be better is because there are so much nice articles with fancy silver light kinda features that i can use but all of them only cater for images saved in folders.

和由于我不是说好了,我很难改变code来看看数据库,而不是使用文件夹图像检索的例子。

And since i am not THAT good its hard for me to change the code to look at the database instead of the examples that uses folders for image retrieval.

我想这样的事情添加到我的网站(通过浏览图像)。
有我的code的例子就如何做到这一点时,图像保存在数据库中?我使用ASP.NET与VB.net。
<一href=\"http://capetown.gumtree.co.za/c-Cars-for-Sale-cars-R35K-BMW-318i-E46-Motorsport-2004-W0QQAdIdZ118186301\">Click这里查看我所谈论

I would like to add something like this to my website (browsing through the images). Any code examples for me on how to do this when images are saved in the database? I am using ASP.NET with VB.net. Click here to view what i am talking about

任何想法家伙?

问候
艾蒂安

推荐答案

我最近做了两者兼得。我使用目录的方法用于存储图像,同时保持在DB其属性preFER。

I've done it both ways recently. I do prefer using the directory method for storing the images while keeping their properties in a DB.

的主要原因是:我有客户端,我做了一个网站。与会者普遍认为,允许他们上传新照片可能从公开网站上浏览的照相馆部分。我的客户没有thinkn上传之前优化thier图像。所以基本上每一个.JPG超过1MB。我做了补充更新一次,它被保存到数据库图像的能力,但它有一次做一个记录。

Main reason: I had client for I made a website for. There was a photogallery section that allowed them to upload new photos which could be browsed from the public site. My client did not thinkn to optimize thier images before uploading. So basically every .jpg was over 1mb. I did add the ability to update an image once it was saved to the DB but it had to be done one record at a time.

如果同样的事情发梗,而存储在目录中的文件可以保存在本地,优化并放回到服务器上。图像

If this same thing happed while storing the images in a directory the files could be saved locally, optimized and put back onto the server.

这里是

这篇关于我应该存储我的图片在数据库或文件夹?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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