Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. Storing images, documents etc in a database

Storing images, documents etc in a database

Scheduled Pinned Locked Moved Database
databasesql-serversysadmintutorialdiscussion
13 Posts 8 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    jgrogan
    wrote on last edited by
    #1

    Guys, I'm relatively new to using databases and have been playing around with SQL Server 2005 to do some stuff. However, I'm looking at extending an application that uses images and documents (mainly pdf) and I want to be able to store these somewhere (ideally in a database). I haven't found any useful information on Google, so wanted to ask others for their suggestions on how to do this. It doesn't have to be on SQL Server and I can basically use any db that's up to the task. Thoughts welcome, John.

    M H N R H 5 Replies Last reply
    0
    • J jgrogan

      Guys, I'm relatively new to using databases and have been playing around with SQL Server 2005 to do some stuff. However, I'm looking at extending an application that uses images and documents (mainly pdf) and I want to be able to store these somewhere (ideally in a database). I haven't found any useful information on Google, so wanted to ask others for their suggestions on how to do this. It doesn't have to be on SQL Server and I can basically use any db that's up to the task. Thoughts welcome, John.

      M Offline
      M Offline
      Mycroft Holmes
      wrote on last edited by
      #2

      jgrogan wrote:

      haven't found any useful information on Google

      Then you are blind, this question is asked at least once a month (if not more often), has been answered with 1000s of excellent articles. Google search works just fine for me[^]. CP article search will give you some excellent articles.

      Never underestimate the power of human stupidity RAH

      1 Reply Last reply
      0
      • J jgrogan

        Guys, I'm relatively new to using databases and have been playing around with SQL Server 2005 to do some stuff. However, I'm looking at extending an application that uses images and documents (mainly pdf) and I want to be able to store these somewhere (ideally in a database). I haven't found any useful information on Google, so wanted to ask others for their suggestions on how to do this. It doesn't have to be on SQL Server and I can basically use any db that's up to the task. Thoughts welcome, John.

        H Offline
        H Offline
        Hiren solanki
        wrote on last edited by
        #3

        I have searched good article from code project to kick end your problem, These articles is neat and really helpful. Articles by sacha[^]
        Aritcle by Kazim[^]
        Article by shabdar[^] It may help you to be familiar with that aspect.

        Regards, Hiren.

        My Recent Article: - Way to know which control have raised PostBack
        My Recent Tip/Trick: - Remove HTML Tag, get plain Text

        1 Reply Last reply
        0
        • J jgrogan

          Guys, I'm relatively new to using databases and have been playing around with SQL Server 2005 to do some stuff. However, I'm looking at extending an application that uses images and documents (mainly pdf) and I want to be able to store these somewhere (ideally in a database). I haven't found any useful information on Google, so wanted to ask others for their suggestions on how to do this. It doesn't have to be on SQL Server and I can basically use any db that's up to the task. Thoughts welcome, John.

          N Offline
          N Offline
          Not Active
          wrote on last edited by
          #4

          C# Photo Album Viewer[^]


          I know the language. I've read a book. - _Madmatt

          1 Reply Last reply
          0
          • J jgrogan

            Guys, I'm relatively new to using databases and have been playing around with SQL Server 2005 to do some stuff. However, I'm looking at extending an application that uses images and documents (mainly pdf) and I want to be able to store these somewhere (ideally in a database). I haven't found any useful information on Google, so wanted to ask others for their suggestions on how to do this. It doesn't have to be on SQL Server and I can basically use any db that's up to the task. Thoughts welcome, John.

            R Offline
            R Offline
            RaviRanjanKr
            wrote on last edited by
            #5

            Yup Mycroft,Hiren and Makr already given you some link for best article over how to save image int database. you can also download the given sample code to learn how to store and retrieve image from SQL server. Click on the given link to Download Sample Codes[^] Hope it will works for you.

            J 1 Reply Last reply
            0
            • R RaviRanjanKr

              Yup Mycroft,Hiren and Makr already given you some link for best article over how to save image int database. you can also download the given sample code to learn how to store and retrieve image from SQL server. Click on the given link to Download Sample Codes[^] Hope it will works for you.

              J Offline
              J Offline
              jgrogan
              wrote on last edited by
              #6

              Guys, Thanks for taking the time to point me at some good articles. Does anyone have any thoughts on storing documents (pdf, xls, doc) etc in a database and how to do it. The only suggestion I've found is to store them in o/s file structure and use the database to store path and some info. What would be the pros / cons of using a DB rather than the O/S? Thanks, John.

              J M 2 Replies Last reply
              0
              • J jgrogan

                Guys, Thanks for taking the time to point me at some good articles. Does anyone have any thoughts on storing documents (pdf, xls, doc) etc in a database and how to do it. The only suggestion I've found is to store them in o/s file structure and use the database to store path and some info. What would be the pros / cons of using a DB rather than the O/S? Thanks, John.

                J Offline
                J Offline
                jschell
                wrote on last edited by
                #7

                See this and then click on the pdf/word docs for the full blown article. http://research.microsoft.com/apps/pubs/default.aspx?id=64525[^]

                1 Reply Last reply
                0
                • J jgrogan

                  Guys, Thanks for taking the time to point me at some good articles. Does anyone have any thoughts on storing documents (pdf, xls, doc) etc in a database and how to do it. The only suggestion I've found is to store them in o/s file structure and use the database to store path and some info. What would be the pros / cons of using a DB rather than the O/S? Thanks, John.

                  M Offline
                  M Offline
                  Mycroft Holmes
                  wrote on last edited by
                  #8

                  jgrogan wrote:

                  oes anyone have any thoughts on storing documents

                  Now thats a different question, why not how, much more interesting. As with anything there are a number of pros and cons, they will depend on your requirements, your hosting environment, the cost of maintenance and infrastructure. Basically 3 styles of storage (using sql server). 1. Files stored in file systems with path in the record. 2. Files stored as binary data in the record 3. Files stored in a database managed file store. 2 means the database may grow dramatically affecting the cost of backup 3 allows you to split the backup to exclude the images (option) reducing backup cost. Then there is the whole discussion around access of the files, 1 requires file management 2 & 3 require database operation. Having used all 3 I still go for 1 as the most widely used and understood. Do not take this as definitive, you need to do some research and balance that with your requirements and budget.

                  Never underestimate the power of human stupidity RAH

                  J R 2 Replies Last reply
                  0
                  • M Mycroft Holmes

                    jgrogan wrote:

                    oes anyone have any thoughts on storing documents

                    Now thats a different question, why not how, much more interesting. As with anything there are a number of pros and cons, they will depend on your requirements, your hosting environment, the cost of maintenance and infrastructure. Basically 3 styles of storage (using sql server). 1. Files stored in file systems with path in the record. 2. Files stored as binary data in the record 3. Files stored in a database managed file store. 2 means the database may grow dramatically affecting the cost of backup 3 allows you to split the backup to exclude the images (option) reducing backup cost. Then there is the whole discussion around access of the files, 1 requires file management 2 & 3 require database operation. Having used all 3 I still go for 1 as the most widely used and understood. Do not take this as definitive, you need to do some research and balance that with your requirements and budget.

                    Never underestimate the power of human stupidity RAH

                    J Offline
                    J Offline
                    jgrogan
                    wrote on last edited by
                    #9

                    Can I assume that the same issues apply to Oracle and mySQL? What about distributed databases such as Cassandra? Does anyone have any experience of that?

                    M 1 Reply Last reply
                    0
                    • J jgrogan

                      Can I assume that the same issues apply to Oracle and mySQL? What about distributed databases such as Cassandra? Does anyone have any experience of that?

                      M Offline
                      M Offline
                      Mycroft Holmes
                      wrote on last edited by
                      #10

                      jgrogan wrote:

                      Can I assume that the same issues apply to Oracle and mySQL?

                      Absolutely NOT each database will have it's own issues and methods. You are moving into a more esoteric area of data storage and all of them will treat it differently. I only have (relevant) experience with sql server.

                      Never underestimate the power of human stupidity RAH

                      1 Reply Last reply
                      0
                      • J jgrogan

                        Guys, I'm relatively new to using databases and have been playing around with SQL Server 2005 to do some stuff. However, I'm looking at extending an application that uses images and documents (mainly pdf) and I want to be able to store these somewhere (ideally in a database). I haven't found any useful information on Google, so wanted to ask others for their suggestions on how to do this. It doesn't have to be on SQL Server and I can basically use any db that's up to the task. Thoughts welcome, John.

                        H Offline
                        H Offline
                        Henry Minute
                        wrote on last edited by
                        #11

                        If there is any chance that this could move to SqlServer 2008, you might consider FileStream Storage[^].

                        Henry Minute Do not read medical books! You could die of a misprint. - Mark Twain Girl: (staring) "Why do you need an icy cucumber?" “I want to report a fraud. The government is lying to us all.”

                        1 Reply Last reply
                        0
                        • M Mycroft Holmes

                          jgrogan wrote:

                          oes anyone have any thoughts on storing documents

                          Now thats a different question, why not how, much more interesting. As with anything there are a number of pros and cons, they will depend on your requirements, your hosting environment, the cost of maintenance and infrastructure. Basically 3 styles of storage (using sql server). 1. Files stored in file systems with path in the record. 2. Files stored as binary data in the record 3. Files stored in a database managed file store. 2 means the database may grow dramatically affecting the cost of backup 3 allows you to split the backup to exclude the images (option) reducing backup cost. Then there is the whole discussion around access of the files, 1 requires file management 2 & 3 require database operation. Having used all 3 I still go for 1 as the most widely used and understood. Do not take this as definitive, you need to do some research and balance that with your requirements and budget.

                          Never underestimate the power of human stupidity RAH

                          R Offline
                          R Offline
                          Ray Cassick
                          wrote on last edited by
                          #12

                          I agree here... I prefer #1 in just about every case. I just never makes sense to me to store the actual images or documents in the DB itself since it really provides you nothing in the way of performance or search capabilities and I think really adds more weight to your DB than is needed. Sure, I would guess that you can gain some backup and restore simplicity but I just don't see that as being a real benefit. Now, it would be cool if you could use a type of image bassed query engine on a DB full of pictures... that would be really neat.. IE: fed in a picture of a particular bird and get back a record set of pictures containing that type of bird, or similar birds with that colorization or marking pattern... but I suspect that would be VERY difficult and not very efficient really. Would still be neat though. I always wanted to try to write a function that you could feed in an image and a folder and have it search through all the images and see if your input image was a subset (IE: copied section) of one of the images in the source folders...


                          LinkedIn[^] | Blog[^] | Twitter[^]

                          J 1 Reply Last reply
                          0
                          • R Ray Cassick

                            I agree here... I prefer #1 in just about every case. I just never makes sense to me to store the actual images or documents in the DB itself since it really provides you nothing in the way of performance or search capabilities and I think really adds more weight to your DB than is needed. Sure, I would guess that you can gain some backup and restore simplicity but I just don't see that as being a real benefit. Now, it would be cool if you could use a type of image bassed query engine on a DB full of pictures... that would be really neat.. IE: fed in a picture of a particular bird and get back a record set of pictures containing that type of bird, or similar birds with that colorization or marking pattern... but I suspect that would be VERY difficult and not very efficient really. Would still be neat though. I always wanted to try to write a function that you could feed in an image and a folder and have it search through all the images and see if your input image was a subset (IE: copied section) of one of the images in the source folders...


                            LinkedIn[^] | Blog[^] | Twitter[^]

                            J Offline
                            J Offline
                            jschell
                            wrote on last edited by
                            #13

                            Ray Cassick wrote:

                            I just never makes sense to me to store the actual images or documents in the DB itself since it really provides you nothing in the way of performance or search capabilities and I think really adds more weight to your DB than is needed.

                            The link I posted does show a performance difference. Additionally a factor could be access control, especially when users are managed as data versus actual db users or system users.

                            1 Reply Last reply
                            0
                            Reply
                            • Reply as topic
                            Log in to reply
                            • Oldest to Newest
                            • Newest to Oldest
                            • Most Votes


                            • Login

                            • Don't have an account? Register

                            • Login or register to search.
                            • First post
                              Last post
                            0
                            • Categories
                            • Recent
                            • Tags
                            • Popular
                            • World
                            • Users
                            • Groups