Displaying a blob stored in mysql...

Discussion in 'PHP' started by Seiya, Mar 3, 2006.

  1. #1
    Nevermind. Mod please close topic i solved it.
     
    Seiya, Mar 3, 2006 IP
  2. stuw

    stuw Peon

    Messages:
    702
    Likes Received:
    44
    Best Answers:
    0
    Trophy Points:
    0
    #2
    I think you need to base64_encode and base64_decode the data going in and out of the db to make sure there are no nasty characters.

    Also you need to give the correct headers - which it looks like your doing.

    The size of the file you are storing may also exceed the packet size of the database, which has caused me problems in the past. See: http://dev.mysql.com/doc/mysql/en/packet-too-large.html

    On a slightly different note, storing images in your db will slow it down. What I tend to do is store images on the filesystem and then store the filename of the image in the database. To make things even quicker store no more than 10 images per folder - the can be easily achieved by using the filename eg
    /images/826575/6.jpg store as /images/82/65/75/6.jpg
     
    stuw, Mar 3, 2006 IP
  3. Seiya

    Seiya Peon

    Messages:
    4,666
    Likes Received:
    404
    Best Answers:
    0
    Trophy Points:
    0
    #3
    "I think you need to base64_encode and base64_decode the data going in and out of the db to make sure there are no nasty characters."

    I did that but when i download my report it still has some small errors, it works but with errors =|
     
    Seiya, Mar 5, 2006 IP