----- Original Message -----
From: "Stephen Patterson" <[EMAIL PROTECTED]>
To: <ed.orton>
Cc: "Perl-Win32-Web Mailing List" <[EMAIL PROTECTED]>;
"Perl-Win32-Users Mailing List (E-mail 2)"
<[EMAIL PROTECTED]>
Sent: Monday, September 24, 2001 4:32 AM
Subject: Re: Slightly off topic - magic and documents types


> Edward G. Orton wrote:
>
> >Sorry if this is a bit off topic, but it's related to perl indirectly. I
> >have a web server which permits users to upload files. I have found that
the
> >uploading browser does not always tag the file correctly i.e.
> >application/msword is often applied to .doc files which were actually
> >created in Word Perfect, so when the files are re-distributed, they
continue
> >to carry the incorrect tag.
> >
> I don't know about win32 webservers, but certainly on Apache (on my
> linux box), works out the content type for a file from the file
> extension, but only when the file is sent out from the server. Are you
> sure that the uploading browser is doing things incorrectly?
The same is true of Windows servers/clients, but the file extension does not
ensure that the file is actually of the type that the extension indicates.
The 'magic' entries look for codes in the file which indicate what it really
is, and then the files can be tagged properly.

The Unix 'file' tool was created to determine file types regardless of file
extension, since, for the most part, unix files do not have extensions. I
have an older version of the 'magic' file which correctly determines the
difference between older Word and WP files, no matter what you call them. I
find this quite useful. The problem is that there are no 'magic' entries for
MSOffice 97 files or later.

ego
Edward G. Orton, GWN Consultants Inc.
Phone: 613-764-3186, Fax: 613-764-1721
email: [EMAIL PROTECTED]

_______________________________________________
Perl-Win32-Web mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-web

Reply via email to