22 Sep
2004
22 Sep
'04
8:17 a.m.
Hi,
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?
I try:
import mimetypes guess_type(myfile.filename)
but I got an the error "*You are not authorized to access this resource".*
I solved my little Problem by using an External Method and the Python-Package mimetypes. Thanks, Patrick