将产品图像保存到服务器或数据库? [英] Saving Product Image to server or database ?

查看:76
本文介绍了将产品图像保存到服务器或数据库?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在为商店制作一个网站...在管理区域中,他将产品标题和描述以及产品图像和菜单中的用户区域选择他显示的产品名称什么是管理员插入的。



但我应该怎么做,将图像保存在数据库中或只是在服务器中?

和如果我将它存储在服务器中如何将其与描述链接?

解决方案

取决于您拥有的产品数量和可用磁盘空间的大小您需要接听此电话的服务器(网络和数据库服务器)。

要存储和检索数据库中的图像,您可以通过以下链接:

< a href =http://www.aspdotnet-suresh.com/2011/01/how-to-insert-images-into-database-and.html> http://www.aspdotnet-suresh.com/2011 /01/how-to-insert-images-into-database-and.html [ ^ ]



如果要存储图像Web服务器文件系统,为此文件生成唯一名称,并将此文件的路径与产品详细信息一起存储在产品表中

例如:如果您有一个名为Products的表,其中包含以下模式:

产品ID(可以是身份或GUID)

名称varchar(255)

ImagePath varchar(255)



显示产品详情时,请将此路径作为图像元素的来源。

希望我很清楚。


在asp.net c#中保存上传的图像 [ ^

I''m making a website for store ... in the admin area he inter the product title and description and an image for the product and in the user area in the menu if he choose the name of the product he show all what is the admin inserted .

but what should i do , save the image in the databse or just in the server ?
and if i stored it in the serve how can i link it with the description ?

解决方案

Depending on the number of products you have and the size of the disk space available on the server (both web and database server) you need to take this call.
To store and retrieve the images from database, you can go through the following link:
http://www.aspdotnet-suresh.com/2011/01/how-to-insert-images-into-database-and.html[^]

If you want to store the image in the web server filesystem, generate a unique name for this file and store the path of this file in the product table along with the product details
For example: If you have a table named Products with the following schema:
Product Id (can be identity or GUID)
Name varchar(255)
ImagePath varchar(255)

When displaying the product details, give this path as the source to the image element.
Hope I am clear.


Saving a uploaded image in asp.net c#[^]


这篇关于将产品图像保存到服务器或数据库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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