![]() |
| Storing Images in MS SQL with ASP.NET |
|
MBMunday
|
I recently tackled the task of storing images (not the image paths, but the actual images) in MS SQL Server and ASP.NET for a project at my full-time job. If anyone is interested in seeing the .vb code, feel free to email me at MBMunday@mbmwc.com and I'll forward you the .vb code and SQL Server table structure.
Regards, MB |
||||||||||||
|
|
|||||||||||||
| Curious... |
|
jamie
HostMySite Sales Rep
![]()
|
Not meaning to sound rude, but why would one want to store the image rather than the path in an MS SQL database? I've known that SQL had the potential to do this for years (you'd be shocked how many people miss that fact), but I always discounted it as a bad idea for various reasons.
|
||||||||||||
|
|
|||||||||||||
| Images |
|
MBMunday
|
We researched this for a while before deciding to do it and decided for our application, it was the best route. We were trying to build a very secure application for a Gang Database for my police department on our Intranet and it just gave us another level of security. The laws governing what police departments can and cannot do, and who can see the information is very strict. This way, the ASP.NET creates a temporary file/image to display on the page and it doesn't show a path to the image. We didn't even want some of the intranet developers to have access to the path of the folder that was holding the images. On the other hand, we thought of securing the server and folders that held the images, etc., etc., but instead of locking down this area here and that area there, we can just give access to the desired table using our Microsoft Active Directory "Group" that we created.
Some people say it is a bad idea to store images in the db, while others say it is okay, depending on your application. It would have been much less of a headache to simply store the path, but it wasn't my decision. Someone else above me (who didn't have to write the application) decided to do it. I was just trying to share my experience if anyone else decided to tackle the task. MB |
||||||||||||
|
|
|||||||||||||
|
jamie
HostMySite Sales Rep
![]()
|
I didn't mean to question your programming direction, just wanted to know why your app would use that particular approach since I hadn't seen any others do so! Thanks for the insight, it's always nice to hear about different ways of coding.
|
||||||||||||
|
|
|||||||||||||
|
MBMunday
|
No problem...You didn't offend me or anything.
MB |
||||||||||||
|
|
|||||||||||||
|
Tony
|
Actually we store a lot of images in our Oracle Database (BLOB). At least in Oracle, the images are scanned documents for financial purposes. It also keeps the security tighter than keeping them on the server directly. Just thought I'd put my 2 cents in.. Which all that its worth..lol
I'm not familiar with Sql Server but I'm an Oracle Database Admin. I know a few Sql Server Database Admins and Developers, I will try to get some answers for you, if possible. Tony |
||||||||||||
|
|
|||||||||||||
| Storing Images in MS SQL with ASP.NET |
|
||
|



