Adding Images to MySQL

Victor Subervi victorsubervi at gmail.com
Tue Apr 1 08:36:00 EDT 2008


Hi;
I´m trying to figure out how to upload images into a MySQL database. (Yes,
that is what I want to do.) I have a form that asks for data, like this:
1ra Foto Pequeña:
<input type='file' name='pic1' />
Then I send that form to a python script that processes like this:
cursor.execute('insert into products (' + col_names + ') values (' +
col_values + ');')
where col_names is all the names of the columns and col_values, obviously,
the values. Works fine for strings and digits. Not so well for files :) What
do?
TIA,
Victor
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20080401/26f7c3b9/attachment.html>


More information about the Python-list mailing list