I am trying to create a user interface in zope to a mysql database that has a BLOB entry. I would like the user to be able to specify a file on the user's filesystem, and put that binary file into the database. I am not sure how best to do this. Does anyone have an example of an SQL method or external method that takes a file from the users system and puts it in as a binary blob into and SQL database? Is it possible to do without first loading entire the contents of the file into memory? I first tried to write an SQL method INSERT INTO eeg VALUES ( <dtml-sqlvar id type="int">, <dtml-sqlvar eeg type="blob">, #this is no good <dtml-sqlvar description type="string"> ); But was not sure how to handle the blob type. This led me to believe that I would have to use and External Method rather than an SQL Method. Suggestions? Thanks, John Hunter
On Tue, 2002-01-01 at 16:46, John Hunter wrote:
I am trying to create a user interface in zope to a mysql database that has a BLOB entry. I would like the user to be able to specify a file on the user's filesystem, and put that binary file into the database.
I am not sure how best to do this. Does anyone have an example of an SQL method or external method that takes a file from the users system and puts it in as a binary blob into and SQL database?
A BLOB is just a string, as far as MySQLdb is concerned.
Is it possible to do without first loading entire the contents of the file into memory?
Nope. -- Andy Dustman PGP: 0x930B8AB6 @ .net http://dustman.net/andy You can have my keys when you pry them from my dead, cold neurons.
participants (2)
-
Andy Dustman -
John Hunter