note 50410 added to features.file-upload
| From: | infoworks-tn dot com at david dot hamilton dot nospam | Date: | Sun, 27 Feb 2005 16:52:33 +0000 |
| Subject: | note 50410 added to features.file-upload | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-85640@lists.php.net to get a copy of this message | ||
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
----
Manual Page -- http://www.php.net/manual/en/features.file-upload.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+50410
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+50410&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+50410&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+50410&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+50410&report=yes&reason=useless
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+50410&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+50410&report=yes
Search -- http://master.php.net/manage/user-notes.php