I had this problem as well while putting large BLOBs into the database. The problem turned out to be that the server had set an upper limit on the amount of data sent at once. If I remember correctly, you can change this in the /etc/mysql/my.cnf file like this:
set-variable = max_allowed_packet=256M
# or something else ridiculously large
blokhead