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. Store Images In SQL Table

Store Images In SQL Table

Scheduled Pinned Locked Moved Database
csharpdatabasewpfquestion
14 Posts 4 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.
  • K Kevin Marois

    I'm working on a WPF app that has user profiles. The profile contains the user's picture. Any reason not to store the image in the Profiles table? Never done this before. Suggestions/comments appreciated. Thanks

    Everything makes sense in someone's mind

    P Offline
    P Offline
    PIEBALDconsult
    wrote on last edited by
    #2

    Kevin Marois wrote:

    Any reason not to store the image in the Profiles table?

    I don't have any; that's what I'd do. If you're not already, you may want to resize the images to some standard before doing so.

    K 1 Reply Last reply
    0
    • P PIEBALDconsult

      Kevin Marois wrote:

      Any reason not to store the image in the Profiles table?

      I don't have any; that's what I'd do. If you're not already, you may want to resize the images to some standard before doing so.

      K Offline
      K Offline
      Kevin Marois
      wrote on last edited by
      #3

      Ok, thanks

      Everything makes sense in someone's mind

      1 Reply Last reply
      0
      • K Kevin Marois

        I'm working on a WPF app that has user profiles. The profile contains the user's picture. Any reason not to store the image in the Profiles table? Never done this before. Suggestions/comments appreciated. Thanks

        Everything makes sense in someone's mind

        L Offline
        L Offline
        Lost User
        wrote on last edited by
        #4

        If you were working on a webapp, then it'd be sweeter to have them on the server directly so that the browser can cache them. Outside of that environment, I prefer to store those things in the database. That way you can backup all the data that belongs together in a single document.

        Bastard Programmer from Hell :suss:

        K 1 Reply Last reply
        0
        • L Lost User

          If you were working on a webapp, then it'd be sweeter to have them on the server directly so that the browser can cache them. Outside of that environment, I prefer to store those things in the database. That way you can backup all the data that belongs together in a single document.

          Bastard Programmer from Hell :suss:

          K Offline
          K Offline
          Kevin Marois
          wrote on last edited by
          #5

          Actually, I'm working on an app thay will have WPF, WinPhone, and Web UI's, so maybe storing them on the server is best.

          Everything makes sense in someone's mind

          P L 2 Replies Last reply
          0
          • K Kevin Marois

            Actually, I'm working on an app thay will have WPF, WinPhone, and Web UI's, so maybe storing them on the server is best.

            Everything makes sense in someone's mind

            P Offline
            P Offline
            PIEBALDconsult
            wrote on last edited by
            #6

            The problem I have with that is if someone replaces a file with one you don't expect.

            J 1 Reply Last reply
            0
            • K Kevin Marois

              Actually, I'm working on an app thay will have WPF, WinPhone, and Web UI's, so maybe storing them on the server is best.

              Everything makes sense in someone's mind

              L Offline
              L Offline
              Lost User
              wrote on last edited by
              #7

              Kevin Marois wrote:

              Actually, I'm working on an app thay will have WPF, WinPhone, and Web UI's, so maybe storing them on the server is best.

              I'd still store them in a database :-\ You'll want a specific folder to store the user-pictures; you don't want to store them between "all other" pics like logo's and the like. This gives also the advantage that you can delete everything in this path and rebuild it with the info from the database, without touching other graphics.

              Bastard Programmer from Hell :suss:

              1 Reply Last reply
              0
              • P PIEBALDconsult

                The problem I have with that is if someone replaces a file with one you don't expect.

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

                PIEBALDconsult wrote:

                The problem I have with that is if someone replaces a file with one you don't expect.

                What does that have to do with how they are stored?

                P 1 Reply Last reply
                0
                • K Kevin Marois

                  I'm working on a WPF app that has user profiles. The profile contains the user's picture. Any reason not to store the image in the Profiles table? Never done this before. Suggestions/comments appreciated. Thanks

                  Everything makes sense in someone's mind

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

                  For small images database is probably best, simply because it is going to be easier to implement.

                  1 Reply Last reply
                  0
                  • J jschell

                    PIEBALDconsult wrote:

                    The problem I have with that is if someone replaces a file with one you don't expect.

                    What does that have to do with how they are stored?

                    P Offline
                    P Offline
                    PIEBALDconsult
                    wrote on last edited by
                    #10

                    The file system is less secure.

                    J 1 Reply Last reply
                    0
                    • P PIEBALDconsult

                      The file system is less secure.

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

                      PIEBALDconsult wrote:

                      The file system is less secure.

                      I doubt that is relevant in a system that needs to be secure. If one does nothing but assume that a database is "more" secure than a file system with no other concern for security then they will have problems. And one a real security policy in place any real differences in implementation of systems at this level becomes much less significant allowing one the freedom to base decisions on other business needs.

                      P 1 Reply Last reply
                      0
                      • J jschell

                        PIEBALDconsult wrote:

                        The file system is less secure.

                        I doubt that is relevant in a system that needs to be secure. If one does nothing but assume that a database is "more" secure than a file system with no other concern for security then they will have problems. And one a real security policy in place any real differences in implementation of systems at this level becomes much less significant allowing one the freedom to base decisions on other business needs.

                        P Offline
                        P Offline
                        PIEBALDconsult
                        wrote on last edited by
                        #12

                        I'll stick with the more secure solution regardless. It's like putting things in a bank vault rather than relying solely on the security guard at the door.

                        J 1 Reply Last reply
                        0
                        • P PIEBALDconsult

                          I'll stick with the more secure solution regardless. It's like putting things in a bank vault rather than relying solely on the security guard at the door.

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

                          PIEBALDconsult wrote:

                          I'll stick with the more secure solution regardless. It's like putting things in a bank vault rather than relying solely on the security guard at the door.

                          Not at all. At least not at most banks, because your analogy is not a complete statement of the security policy in place at the bank. For instance...how is the vault secure if the door to it is left open, the front door to the bank is left open and there is no active security monitoring system in place? And note that several years ago one large study found that 90% of security problems with actual losses originated internally within the company.

                          P 1 Reply Last reply
                          0
                          • J jschell

                            PIEBALDconsult wrote:

                            I'll stick with the more secure solution regardless. It's like putting things in a bank vault rather than relying solely on the security guard at the door.

                            Not at all. At least not at most banks, because your analogy is not a complete statement of the security policy in place at the bank. For instance...how is the vault secure if the door to it is left open, the front door to the bank is left open and there is no active security monitoring system in place? And note that several years ago one large study found that 90% of security problems with actual losses originated internally within the company.

                            P Offline
                            P Offline
                            PIEBALDconsult
                            wrote on last edited by
                            #14

                            jschell wrote:

                            originated internally within the company.

                            Which is my point too. Generally, more people have access to the file system than to the database. A no-longer-gruntled sys admin could replace individual files, but not alter the contents of the database.

                            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