Announcement

Collapse
No announcement yet.

Using SQLite BLOB for audio/video

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

  • Using SQLite BLOB for audio/video

    Has anybody successfully stored / retrieved an MP3 or MPG files TO/FROM BLOB in SQlite database ?
    Any examples, tips ?

    Arthur
    -----------------------------------------
    Arthur Klisiewicz
    dATA POINT SOFTWARE
    www.datapointsoftware.com

  • #2
    Not from php no. As SQLite in essence stores everything in text format I don't recommend doing so. But technically it should be possible. From Delphi I stored loads of images which is more-or-less same blob issue. But issues you might run into is the size of the MP3 files. Using a db upload field might fail due to upload restrictions set in php.ini
    Albert Drent
    aducom software netherlands
    scriptcase partner, reseller, support and (turn-key) development
    www.scriptcase.eu / www.scriptcase.nl

    Comment


    • #3
      You can do this when you convert it when saving it and converting it back...
      An easy way would be to base64 encode it so it is simply a long text string. Converting it back would be a simple decode then...
      AN alternative way may be achieved (not tested by me) is to use quote and hex.

      quote: The quote(X) function returns the text of an SQL literal which is the value of its argument suitable for inclusion into an SQL statement. Strings are surrounded by single-quotes with escapes on interior quotes as needed. BLOBs are encoded as hexadecimal literals. Strings with embedded NUL characters cannot be represented as string literals in SQL and hence the returned string literal is truncated prior to the first NUL.

      hex: The hex() function interprets its argument as a BLOB and returns a string which is the upper-case hexadecimal rendering of the content of that blob.

      So you see that if you use these two functions you may get it to work. For the base 64 encode/decode you would have to use php encode decode.. So it is slightly tricky but it should be able.

      I advise to keep the files stored on a normal path tho, since this would make access faster and keep your database smaller. And it is easily supported in scriptcase...

      Comment


      • #4
        From Delphi I stored loads of images which is more-or-less same blob issue. But issues you might run into is the size of the MP3 files. Using a db upload field might fail due to upload restrictions set in php.ini
        http://www.braindumps.com/MCSA.htm
        http://www.icdl.com/
        http://www.kyoto-u.ac.jp/en
        http://en.wikipedia.org/wiki/Amridge_University

        Comment


        • #5
          Why repeat my post????
          Albert Drent
          aducom software netherlands
          scriptcase partner, reseller, support and (turn-key) development
          www.scriptcase.eu / www.scriptcase.nl

          Comment

          Working...
          X