diff --git a/lib/preview/unknown.php b/lib/preview/unknown.php
index 6b161424917e2f33ff98d5f3d97ff19805919054..6e1dc06c1bca7f310b1c063026d90c92ca0cbcea 100644
--- a/lib/preview/unknown.php
+++ b/lib/preview/unknown.php
@@ -15,12 +15,24 @@ class Unknown extends Provider {
 	}
 
 	public function getThumbnail($path, $maxX, $maxY, $scalingup, $fileview) {
-		/*$mimetype = $fileview->getMimeType($path);
-		$info = $fileview->getFileInfo($path);
-		$name = array_key_exists('name', $info) ? $info['name'] : '';
-		$size = array_key_exists('size', $info) ? $info['size'] : 0; 
-		$isencrypted = array_key_exists('encrypted', $info) ? $info['encrypted'] : false;*/ // show little lock
-		return new \OC_Image();
+		$mimetype = $fileview->getMimeType($path);
+		if(substr_count($mimetype, '/')) {
+			list($type, $subtype) = explode('/', $mimetype);
+		}
+
+		$iconsroot = \OC::$SERVERROOT . '/core/img/filetypes/';
+
+		$icons = array($mimetype, $type, 'text');
+		foreach($icons as $icon) {
+			$icon = str_replace('/', '-', $icon);
+
+			$iconpath = $iconsroot . $icon . '.png';
+
+			if(file_exists($iconpath)) {
+				return new \OC_Image($iconpath);
+			}
+		}
+		return false;
 	}
 }