Appreciate everyone's help...using the MEDIUMBLOB should suffice my
needs...actually I try to keep images under 50kb, so I thought the BLOB
would work.  It did until I began using images over ~40kb. It would nice to
know if it is an OS reporting limitation or with mySQL.

Thanks Ben

Gerald E Buckmaster Jr
Imagery Analysis Support Site
www.imagery-analyst.com
www.buckoptimized.com


  -----Original Message-----
  From: Ben Gollmer [mailto:[EMAIL PROTECTED]]
  Sent: Monday, January 15, 2001 1:13 AM
  To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
  Subject: Re: mySQL cache, BLOB, Apache or PHP limits on uploads?


  As per section 7.3 of the manual (Column Types):

  --snip--
  BLOB/TEXT: A BLOB or TEXT column with a maximum length of 65535 (2^16 - 1)
characters.

  MEDIUMBLOB/MEDIUMTEXT: A BLOB or TEXT column with a maximum length of
16777215 (2^24 - 1) characters.

  LONGBLOB/LONGTEXT: A BLOB or TEXT column with a maximum length of
4294967295 (2^32 - 1) characters. Note that because the server/client
protocol and MyISAM tables has currently a limit of 16M per communication
packet / table row, you can't yet use this the whole range of this type.
  --snip

  The full text is at http://www.mysql.com/doc/C/o/Column_types.html.

  The BLOB type should be capable of storing binary data up to 64KB in size,
but I've run into errors before with images all the way down to 40KB. It
probably depends on how well your operating system reports file size (and
maybe the MySQL server's filesystem as well). Make your columns LONGBLOB and
you should be good to go.

  Ben Gollmer
  Jatosoft, LLC
  http://www.jatosoft.com/



  At 01:02 PM 1/14/2001, you wrote:

    Hello Readers!

    I believe I have a upload or a cache limit set too small in a
configuration
    file...I just can't seem to place my eyes on which one.

    This is what is happening: the bottom portion of any image larger than
~45
    Kb, stored as a BLOB in mySQL 2.22.24-shareware-debug server is not
    displaying.  I see no errors - mySQL, Apache 3.14, or PHP 4.04.

    I'm not sure how to verify the BLOB's actual size against the orginal
    image's filesize, as the column 'filesize' stores the original file's
    filesize, not how data was actually written to the column.  Is that a
    correct statement?  So my troubleshooting efforts have been limited to
    finding out the kilobyte ceiling before I begin experiencing the above
    symptoms, skimming through the manual, keyword searching the archives,
etc.

    Can someone help me out...I do RTFM, and in most cases WMOFM, but I have
    really found firm ground to start from.  Someone please jumpstart me!

    TIA

    // Here's my form to collect the file and other data:

    <form name="addtoyform" method="post" action="content.php"
    enctype="multipart/form-data">
            <input type="hidden" name="MAX_FILE_SIZE" value="1000000">
            Image:&nbsp;<input type="file" name="toy_image" size="50">&nbsp;
            toy Name:&nbsp;<input type="text" name="toy_name"
size="25"><br><br>&nbsp;
            Function:&nbsp;<input type="text" name="toy_function"
size="20">&nbsp;
            <? include("filltoytypeselect.inc"); ?>
            toy Description:<br><textarea name="toy_desc" cols="60"
    rows="5"></textarea><br>
    <input type="submit" name="appendtoy" value="Add This toy"></form>



    // Here's my routine to append the collected form data to the table:

    if ($appendtoy) { //  append an binary image depicting a toy
            $data = addslashes(fread(fopen($toy_image, "r"),
filesize($toy_image)));
            $result=MYSQL_QUERY("INSERT INTO inventory

(toy_name,toy_type,toy_function,toy_desc,toy_image,filename,filesize,filetyp
    e)
    VALUES

('$toy_name','$toy_type','$toy_function','$toy_desc','$data','$toy_image_nam
    e','$toy_image_size','$toy_image_type')");
            $id= mysql_insert_id();
            $page_topic = $toy_type;
    }



    // This is my routine to fill an img src with the BLOB using syntax:
<img
    src="gettoyimage.php?toy_id=<toy_id>"

    if($toy_id) {

        @MYSQL_CONNECT("host","username","password");
        @mysql_select_db("database");

        $query = "select toy_image,filetype from inventory where
    toy_id=$toy_id";
        $result = @MYSQL_QUERY($query);

        $data = @MYSQL_RESULT($result,0,"toy_image");
        $type = @MYSQL_RESULT($result,0,"filetype");

        Header( "Content-type: $type");
        echo $data;

    };




    * Gerald E Buckmaster Jr *
    * Professional Imagery Analyst *
    * Amateur Webmaster, Imagery Analysis Support Site *
    * www.imagery-analyst.com *
    * www.buckoptimized.com  *
    * Tucson, Arizona *


    ---------------------------------------------------------------------
    Before posting, please check:
       http://www.mysql.com/manual.php  (the manual)
       http://lists.mysql.com/          (the list archive)

    To request this thread, e-mail <[EMAIL PROTECTED]>
    To unsubscribe, e-mail
<[EMAIL PROTECTED]>
    Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to