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. General Programming
  3. WPF
  4. File in DB or just Path

File in DB or just Path

Scheduled Pinned Locked Moved WPF
databasesysadminquestion
10 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.
  • M Offline
    M Offline
    mehrdadc48
    wrote on last edited by
    #1

    Hi, I know it's not completely related to this section, but I'm developing a silverlight application that is going to get user advertises in image and video format. I'm ambigious about saving the content in db as binary or saving the files and in server hard and just putting the pathes in DB. It shoud has a lot of advertises. Which approach I shoud select?

    Best wishes

    M 1 Reply Last reply
    0
    • M mehrdadc48

      Hi, I know it's not completely related to this section, but I'm developing a silverlight application that is going to get user advertises in image and video format. I'm ambigious about saving the content in db as binary or saving the files and in server hard and just putting the pathes in DB. It shoud has a lot of advertises. Which approach I shoud select?

      Best wishes

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

      I'm just finalising my application, lots of photos and forms to be up/down loaded and I'm still ambiguous. I opted for the file path but just ran across an issues where they may want files with the same name, debated moving to the database but decided to prefix the file with the ID from the database instead. I struggled getting the DB operations to be consistently reliable.

      Never underestimate the power of human stupidity RAH

      P 1 Reply Last reply
      0
      • M Mycroft Holmes

        I'm just finalising my application, lots of photos and forms to be up/down loaded and I'm still ambiguous. I opted for the file path but just ran across an issues where they may want files with the same name, debated moving to the database but decided to prefix the file with the ID from the database instead. I struggled getting the DB operations to be consistently reliable.

        Never underestimate the power of human stupidity RAH

        P Offline
        P Offline
        Pete OHanlon
        wrote on last edited by
        #3

        Mycroft Holmes wrote:

        I'm just finalising my application, lots of photos and forms to be up/down loaded and I'm still ambiguous. I opted for the file path but just ran across an issues where they may want files with the same name, debated moving to the database but decided to prefix the file with the ID from the database instead.

        The normal method for doing this is to give each file a unique name (say generated as a GUID), and store the unique name against the original name in the database.

        I have CDO, it's OCD with the letters in the right order; just as they ruddy well should be

        Forgive your enemies - it messes with their heads

        My blog | My articles | MoXAML PowerToys | Onyx

        M 1 Reply Last reply
        0
        • P Pete OHanlon

          Mycroft Holmes wrote:

          I'm just finalising my application, lots of photos and forms to be up/down loaded and I'm still ambiguous. I opted for the file path but just ran across an issues where they may want files with the same name, debated moving to the database but decided to prefix the file with the ID from the database instead.

          The normal method for doing this is to give each file a unique name (say generated as a GUID), and store the unique name against the original name in the database.

          I have CDO, it's OCD with the letters in the right order; just as they ruddy well should be

          Forgive your enemies - it messes with their heads

          My blog | My articles | MoXAML PowerToys | Onyx

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

          I hadn't thought of the guid, I hadn't thought much about it at all which is not good. Prefixing with the record id will at least leave me with a readable file name.

          Never underestimate the power of human stupidity RAH

          P 1 Reply Last reply
          0
          • M Mycroft Holmes

            I hadn't thought of the guid, I hadn't thought much about it at all which is not good. Prefixing with the record id will at least leave me with a readable file name.

            Never underestimate the power of human stupidity RAH

            P Offline
            P Offline
            Pete OHanlon
            wrote on last edited by
            #5

            Don't worry about it - you've created a perfectly valid way of making the file name unique. The Guid approach is just one such approach.

            I have CDO, it's OCD with the letters in the right order; just as they ruddy well should be

            Forgive your enemies - it messes with their heads

            My blog | My articles | MoXAML PowerToys | Onyx

            realJSOPR 1 Reply Last reply
            0
            • P Pete OHanlon

              Don't worry about it - you've created a perfectly valid way of making the file name unique. The Guid approach is just one such approach.

              I have CDO, it's OCD with the letters in the right order; just as they ruddy well should be

              Forgive your enemies - it messes with their heads

              My blog | My articles | MoXAML PowerToys | Onyx

              realJSOPR Offline
              realJSOPR Offline
              realJSOP
              wrote on last edited by
              #6

              Using a GUID for a filename also makes it impossible to identify a file if yuo have to manually wade throuh a directory to find something. 5CAABC01-8A13-4708-AB1F-35A5349C99EC.jpg 05062E0E-9DAD-4aa0-832B-40DB1B8F0F73.jpg Of those two file names, which one is picture of your dog, and which is the picture of some sweet young thing at the beach that your wife doesn't know you snapped a picture of? :)

              .45 ACP - because shooting twice is just silly
              -----
              "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997
              -----
              "The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001

              P M 2 Replies Last reply
              0
              • realJSOPR realJSOP

                Using a GUID for a filename also makes it impossible to identify a file if yuo have to manually wade throuh a directory to find something. 5CAABC01-8A13-4708-AB1F-35A5349C99EC.jpg 05062E0E-9DAD-4aa0-832B-40DB1B8F0F73.jpg Of those two file names, which one is picture of your dog, and which is the picture of some sweet young thing at the beach that your wife doesn't know you snapped a picture of? :)

                .45 ACP - because shooting twice is just silly
                -----
                "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997
                -----
                "The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001

                P Offline
                P Offline
                Pete OHanlon
                wrote on last edited by
                #7

                That's what the database is for.

                I have CDO, it's OCD with the letters in the right order; just as they ruddy well should be

                Forgive your enemies - it messes with their heads

                My blog | My articles | MoXAML PowerToys | Onyx

                M 1 Reply Last reply
                0
                • P Pete OHanlon

                  That's what the database is for.

                  I have CDO, it's OCD with the letters in the right order; just as they ruddy well should be

                  Forgive your enemies - it messes with their heads

                  My blog | My articles | MoXAML PowerToys | Onyx

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

                  Pete O'Hanlon wrote:

                  That's what the database is for.

                  You are starting to sound like SAP/SAS Thats what the data dictionary is for. X|

                  Never underestimate the power of human stupidity RAH

                  1 Reply Last reply
                  0
                  • realJSOPR realJSOP

                    Using a GUID for a filename also makes it impossible to identify a file if yuo have to manually wade throuh a directory to find something. 5CAABC01-8A13-4708-AB1F-35A5349C99EC.jpg 05062E0E-9DAD-4aa0-832B-40DB1B8F0F73.jpg Of those two file names, which one is picture of your dog, and which is the picture of some sweet young thing at the beach that your wife doesn't know you snapped a picture of? :)

                    .45 ACP - because shooting twice is just silly
                    -----
                    "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997
                    -----
                    "The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001

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

                    Pete may have a point here, my wife has absolutely no idea how a database works.

                    Never underestimate the power of human stupidity RAH

                    realJSOPR 1 Reply Last reply
                    0
                    • M Mycroft Holmes

                      Pete may have a point here, my wife has absolutely no idea how a database works.

                      Never underestimate the power of human stupidity RAH

                      realJSOPR Offline
                      realJSOPR Offline
                      realJSOP
                      wrote on last edited by
                      #10

                      I was talking about the files being on disk. If they're actually in the database, you should be safe.

                      .45 ACP - because shooting twice is just silly
                      -----
                      "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997
                      -----
                      "The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001

                      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