File Upload Truncated

I have a problem uploading files into a MySQL database (4.1.18) using
Lighttpd (1.4.11) and the MySQL C api (2.7). All the files that I
upload are truncated at about 65K, though, the temp file is the correct
length. No errors are thrown and the max_allowed_packet is set to 10GB.
I'm running on OSX.

Any thoughts or pointers are much appreciated.

rails migrations create blobs by default, which in MySQL have a limit
of 65K.