Click here to Skip to main content
15,895,709 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
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 ?
Posted

 
Share this answer
 
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.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900