So let's say I've got a CGI application in which a user may upload a large file (let's say a few hundred MB). If all I needed to do with this file was write it to disk, it's relatively easy to read a few chunks and then write a few chunks so that the entire file doesn't get buffered in to memory first. But instead, I need to store that file in a MySQL database table. Is there a good way to do this without buffering the entire upload into memory first and then executing one big INSERT statement?