Last post Nov 01, 2010 02:38 PM by logosoftv
Oct 26, 2010 06:01 AM|mr_mojtaba|LINK
If i want to create a web site that take your picture and share it for your friends, what the best way to save the picture files on server? What the way is safer for the picture files? What the way has the best performance?
Please help me
With Regards. Mojtaba
Oct 26, 2010 06:27 AM|bhavik.y.shah|LINK
there are many techniques to save your picture on server.
I have personally used two of them.
One is to save picture in DB in binary format as well as save path of the picture where you save it.
I think both of them are good and well on performance bases and also it depends on your situation that how much time it takes to fetch the data.
I think you can save path in DB rather than saving image info in binary format.
Oct 26, 2010 09:07 AM|mr_mojtaba|LINK
Thanks. If i want to save the path of picture in DB, I need to create a new field nchar in Sql DB to save te path of picture in it. How i define the length of nchar field (20 char or 30 or more)?
Oct 26, 2010 09:44 AM|bhavik.y.shah|LINK
No for that you need to take image data type that is available in SQL Managment studio.
Oct 27, 2010 02:57 AM|mr_mojtaba|LINK
I want to save the path of image in DB. The image data type save the image in DB as array byte. i dont want save the image to DB, I want to save the path of image to DB. Then i need to create a new nchar data type to save the path. But How can i define the
length of nchar data type? What the maximum length of nchar data type for it?
Oct 27, 2010 03:18 AM|aamiranga|LINK
Simple create a new column in your db(table that you want to save image path in) and set its data type to VARCHAR(LENGTH).
Here LENGTH can be up to 8000.
imagepath varchar(500) //you can change 500 with any value like 100,200,300... up to 8000 as per your need.
So , with this column, you can save your image path.
If this is what you want then that's all!
Oct 28, 2010 11:30 AM|smd_yasin|LINK
you can use varchar(max)
check this link
Oct 28, 2010 11:37 AM|kjshaju|LINK
varchar(100) would be ideal.
Oct 28, 2010 11:47 AM|atconway|LINK
If i want to create a web site that take your picture and share it for your friends, what the best way to save the picture files on server?
Some of this might depend on which version of SQL Server you use. For example, on older versions of SQL server, you need to take into consideration bloating issues with the size of the database when pumping in tons of files. However, using 'FILESTREAM
Storage in SQL Server 2008' is a good way to have the best of both worlds:
FILESTREAM Storage in SQL Server 2008:
If you are using an older version of SQL, I would place those files on the file system directly as opposed to SQL Server. The only reason I would store files within SQL Server is if I needed its security model to protect those files. A good conversion
on this topic is in the link below:
Which is better ? Storing images in BLOB or in the File System ?
Nov 01, 2010 02:38 PM|logosoftv|LINK
If you like to save image in SQL Server then go with binary image of SQL Server.
If you wish to save the path of the Image in server then take image path and save it in a table. You can use the column's datatype as VARCHAR(MAX) instead of VARCHAR(100). It's not occupying any storage space in SQL Server memory.
Sr. Software Engineer | Without us then who? |
919952070572 | My Blog