17 Sep
2004
17 Sep
'04
8:43 p.m.
Patrick Ulmer wrote at 2004-9-17 09:43 +0200:
I want to allow uploading files from my website and put it in a database. My short script works:
if myfile and myfile.filename != '': container.dbUpdateFile (id=str (id_ds), myfile=myfile.read ())
Now I want to put the mimetype in the database put how can I get the mimetype?
There is a "guess_mimetype" (or similarly spelled) that does this job for "OFS.Image". See there, how it is used. You may need an External Method (or special security declaration see "PythonScripts.README") to overcome security restrictions. -- Dieter