diff --git a/lib/helper.php b/lib/helper.php
index 2ded7b13c384d3dbfe0b2297762d778b1a5ffb7b..480c3fe930e368d33a294612687f20ed5912503e 100644
--- a/lib/helper.php
+++ b/lib/helper.php
@@ -378,6 +378,12 @@ class OC_Helper {
 
 			//trim the character set from the end of the response
 			$mimeType=substr($reply,0,strrpos($reply,' '));
+
+			//trim ; 
+			if (strpos($mimeType, ';') !== false) {
+				$mimeType = strstr($mimeType, ';', true);
+			}
+
 		}
 		if ($mimeType=='application/octet-stream') {
 			// Fallback solution: (try to guess the type by the file extension