Hi: I am able (finally) to upload an image to the database. However, when I try to retrieve it, I get a string literal. Here is my code:
#!/usr/local/bin/python import cgitb; cgitb.enable() import MySQLdb def test(): host = 'mysqldb2.ehost-services.com' user = 'user' passwd = 'pass' db = 'bre' db = MySQLdb.connect(host=host, user=user, passwd=passwd, db=db) cursor= db.cursor() cursor.execute('select pic1 from products where id="3";') content = cursor.fetchall() # print 'Content-Type: image/jpeg\r\nContent-Length: %d\n' % len(content) print 'Content-Type: image/jpeg\r\n' print '<html><body>\n' print content print '</body><html>\n' cursor.close() test() (Apparently, Plesk doesn´t like if __name__ == '__main__': ) The commented out line gives me a leading less than sign...and that´s it. What do? TIA, Victor
-- http://mail.python.org/mailman/listinfo/python-list