note 50410 deleted from features.file-upload by danbrown
| From: | danbrown@php.net | Date: | Sun, 17 May 2009 18:49:13 +0000 |
| Subject: | note 50410 deleted from features.file-upload by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-155179@lists.php.net to get a copy of this message | ||
Note Submitter: infoworks-tn dot com at david dot hamilton dot nospam
----
Regarding the post by therebechips below about saving attachments to a MySQL database. Here are
some items that he forgot to mention:
Make sure your datafield is type text for storing the chunks in. base64_encode translates binary
into text (in a nutshell).
Also, the max size for a text field is 65535. In his example he used 50,000 for the MAX_SQL chunks
to put into the database. If you do this, the encoded data is too large to fit in the field and is
truncated. Use 40,000 instead to be safe. It took me a few hours to realize why my images were
coming back out of the database corrupted.
Other than that, his example worked very well.
If you want to email me, flip the two parts of my email address around and remove .nospam
David Hamilton