file/directory format/size help

moishyyehuda at gmail.com moishyyehuda at gmail.com
Sun Dec 24 10:45:32 EST 2006


Hi

I am writing a script to upload images. How do I check the format of
the file? How can I tell if the file is an image, movie, or text file?
I would also like to put a limit on how much a user can upload. So how
can I check how many bits, bytes, mb, gb are in a folder.

So that sums up to

#1 What type of file is the file? Is it a movie, image, or text
document?
#2 What particular form is the file jpeg, bmp, gif etc.?
#3 The size of a directory?

Thanks




More information about the Python-list mailing list