Absolutely, and it's pretty easy.
All you need to do is break the file name down in order to get the file extension and then match that extension with the appropriate image.
<?php
//this is your file name
$file = 'document.zip';
//this gets the file extension by finding the last period in the file name
//and keeps only the portion of the string that comes after the last period
$ext = strrchr($file, '.');
//then you set up an array with keys that represent the file type and values
//that represent the image names to match up with the file types
$associations = array(
'.zip' => 'compress.gif',
'.doc' => 'words.gif',
'.exe' => 'binary.gif'
);
foreach ($associations as $key=>$value) {
if ($ext == $key) {
$image = $value;
}
}
echo "This file has the extension \"$ext\", which means it gets the \"$image\" image.";
?>