Finding out document type for a stored file.
| From: | Alexis Antonakis | Date: | Sun, 28 Oct 2001 14:11:46 +0000 |
| Subject: | Finding out document type for a stored file. | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-72621@lists.php.net to get a copy of this message | ||
Hi all,
I am trying to find out what the mime type is for files that are stored on
my webserver, so I can convert the contents into a database.
Basically, if it is in 'text/richtext' format I want to run one routine, if
it's in 'application/msword' format another routine, and everything else
another.
I can retrieve this fine when a user uploads a file to the server, by using
the '<input type=file name=userfile>' command ($userfile_type), but I am
stuck when retrieving the file from the server.
All I can think of is to 're-upload' the file, but there must be a more
efficient way.
Any help would be most appreciated.
Many thanks
Alexis