Re: FTP type proposed solution..

From: Goncalo Valverde <grumbler@dont-contact.us>
Date: Wed, 26 Feb 1997 19:02:30 +0100 (MET)

 Well, another argument in favor of the solucion proposed of checking the
first bytes of the file is the folowing cenario:
 Imagine you have a file called

foobar.zip.txt which is a text description to foobar.zip. Since this is an
ascii file the mime type should be text/plain.
 But in ftpget in mime_get_type we got the folowing:

/*
 * If there are two extensions and both are listed in the types table
 * then return the leftmost extention type. The rightmost extention
 * type becomes the content encoding (eg .gz)
 */

 So ftpget looks at the file name and thinks: "humm.. this seems a text
file.. but wait! it as another extension just before .txt... its .zip!
Ahah! you think you could fool me! This is a zip file! so the mime type is
application/x-zip-compressed" .. which is obviously wrong ..

--
____
\       Esoterica - Novas Tecnologias de Informacao, SA
:-)     Goncalo Valverde
/___,   grumbler@esoterica.pt
Received on Wed Feb 26 1997 - 10:12:01 MST

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:34:33 MST