Reg file uploading
Sybren Stuvel
sybrenUSE at YOURthirdtower.com.imagination
Wed Jul 20 05:35:42 EDT 2005
praba kar enlightened us with:
> When we upload a file to the remote server we can get file type
> through file extentions.
No you can't, you can only make a better guess. If I name my PNG file
somefile.jpg, you won't be able to get the file type through file
extentions.
> How we can find out file type if a file doesn't have any
> extentions?
One method is to look at the Content-type header the client sent along
with the file. Another way is through the 'file' command.
Sybren
--
The problem with the world is stupidity. Not saying there should be a
capital punishment for stupidity, but why don't we just take the
safety labels off of everything and let the problem solve itself?
Frank Zappa
More information about the Python-list
mailing list