I posted a problem I was having with this, but unfortunately nobody responded. Regardless, here are the methods I've used:
1) using LOAD_FILE(): INSERT INTO table_name (column_name) VALUES(LOAD_FILE('/absolute/path/to/file')); In windows, of course, the path to the file should probably follow the "c:\path\to\file" form. This will also only work from the server machine. 2) using a piece of middleware (PHP, Perl, etc.) to create a query that contains the contents of the file in the INSERT. In PHP, something like this suffices: $filename = '/absolute/path/to/file'; $fh = fopen($filename,'r'); $query = 'INSERT INTO table_name (column_name) VALUES("'; $query .= addslashes(fread($fh,filesize($filename))); $query .= '")'; $res = mysql_query($query); With either method, the amount of memory you allocate for MySQL (in my.cnf) will determine how large of a file you can insert into your table (BLOB columns can contain 65535 bytes, MEDIUMBLOBs ~16MB, and LONGBLOBs ~4GB). I've had difficulty ("out of memory" errors, corrupted tables, NULL values) inserting values larger than 2MB in LONGBLOB columns, though, so be forewarned. -- shawn allen | [EMAIL PROTECTED] > I need to store large files in a MySQL database (in Windows). To do > this, I have created a table that has a BLOB column. How can I insert > the files into this table? > > Thanks, > > Ron > > > --------------------------------------------------------------------- > Before posting, please check: > http://www.mysql.com/manual.php (the manual) > http://lists.mysql.com/ (the list archive) > > To request this thread, e-mail <[EMAIL PROTECTED]> > To unsubscribe, e-mail <[EMAIL PROTECTED]> > Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php > --------------------------------------------------------------------- Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php