Announcement

Collapse
No announcement yet.

saving binary files to a database

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • saving binary files to a database

    When saving database information with attachments like JPG's or PDF files, I've always saved the binary file in it's own directory and simply made a link pointing to it in the database. I have to believe that it is common practice to embed the file in the database.

    To accomplish this, I'm guessing you have some sort of dynamically sized binary field in a table that relates to your main data and that you simply read the file and save it, and reverse the process to write it.

    The main reason I'm doing this is the security issue of leaving say, a sensitive PDF file floating out on a web server or something.

    Any advice or pitfalls I should watch for?

    I'm using SqlTools Pro and a MySql server.

    Thanks!

  • #2
    Someone here (Bob Melcher?) just posted a question and engendered a lot of responses re options and techniques on this very subject.... Within the last two weeks I'm pretty sure.
    Michael Mattias
    Tal Systems (retired)
    Port Washington WI USA
    [email protected]
    http://www.talsystems.com

    Comment


    • #3
      right you are

      User to user discussions of third-party addons and user-recommended links to related web sites. Advertisements are permitted only in this forum, for products designed to work with and enhance PowerBASIC compilers.


      I searched before but this time just searched for posts by Bob.

      Thanks!

      Comment


      • #4
        The 'subject' of that post sure didn't help your search, either. "Sql Tools and blob fields" is not where I would have started had I been looking for "PDF files to database"
        Michael Mattias
        Tal Systems (retired)
        Port Washington WI USA
        [email protected]
        http://www.talsystems.com

        Comment


        • #5
          Originally posted by Michael Mattias View Post
          The 'subject' of that post sure didn't help your search, either. "Sql Tools and blob fields" is not where I would have started had I been looking for "PDF files to database"
          Tags, anyone?

          ==============================================
          "When you do the common things in life
          in an uncommon way,
          you will command the attention of the world."
          George Washington Carver (1864-1943)
          ==============================================
          It's a pretty day. I hope you enjoy it.

          Gösta

          JWAM: (Quit Smoking): http://www.SwedesDock.com/smoking
          LDN - A Miracle Drug: http://www.SwedesDock.com/LDN/

          Comment


          • #6
            >Tags, anyone?

            Someone did put tags on that post, but I'm not even sure "blob" "sql tools" and "pdf" would have helped a whole lot. If you're not using the third-party product Sql Tools, and don't know that 'blob' is an acronym (Binary Long Object), often but not necessarily associated with 'Database,' you're left with "PDF" and who knows how many posts there are here with "PDF" as a subject/tag.

            There's so much stuff on this board now you could almost play "The Google Game" where the winner is whomever can come up with a search term returning EXACTLY ONE 'hit.'

            MCM
            Michael Mattias
            Tal Systems (retired)
            Port Washington WI USA
            [email protected]
            http://www.talsystems.com

            Comment


            • #7
              Shawn --

              Have you checked out the sample programs called SaveLongData.BAS and ReadLongData.BAS, which are included with SQL Tools?

              The only pitfalls that I know about are ODBC driver quirks, such as the one that Bob M. ran into.

              -- Eric Pearson, Perfect Sync, Inc.
              "Not my circus, not my monkeys."

              Comment

              Working...
              X