Mobile app version of vmapp.org
Login or Join
Merenda212

: Saving Image Path in SQL server I want to know a proper way of saving image path to SQL server when working with ASP.net. I'm using SQL server 2005 & VB 2008.

@Merenda212

Posted in: #AspNet #Images #Sql

I want to know a proper way of saving image path to SQL server when working with ASP.net.
I'm using SQL server 2005 & VB 2008.

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Merenda212

1 Comments

Sorted by latest first Latest Oldest Best

 

@Cofer257

Once you've uploaded it will be somewhere in your webroot most likely (unless you specify otherwise)

What I've done in the past for this type of thing (using PHP though) is rename the file to something that will be unique if they're all going into the same directory (like add the timestamp to the image name at the beginning.

Then once you have that name, write only it to your DB as a varchar datatype.

When you need to call it, you should know the path where your upload script is storing the files, so you would just concat the name stored in the DB to the "img_root_path" or whatever you want to call your path to the files.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme