Determining Content-Type

Andreas Pauley andreasp at qbcon.com
Tue Jan 23 07:18:39 EST 2001


Hi,
I would like to know if there is a way for me to determine the HTTP
Content-Type header of a file residing on disk.
My application inserts a file into the database as a blob, and at the
same time populates a few other fields including the one for the
Content-Type.
This field should then be used by other programs for
displaying/outputting the file to a web browser.

My setup is as follows:
OS: Linux (Red Hat 6.2 or Mandrake 7.2, with a 2.2.x kernel)
Python version: 2.0

Thanks,
Andreas Pauley.
-- 
... Any resemblance between the above views and those of my employer,
my terminal, or the view out my window are purely coincidental.  Any
resemblance between the above and my own views is non-deterministic. 
The
question of the existence of views in the absence of anyone to hold them
is left as an exercise for the reader.  The question of the existence of
the reader is left as an exercise for the second god coefficient.  (A
discussion of non-orthogonal, non-integral polytheism is beyond the
scope
of this article.)



More information about the Python-list mailing list