diff --git a/src/app/resource/controllers/ResController.php b/src/app/resource/controllers/ResController.php
index 43c95ad151f92355ad25077fedf335e40430150a..9de6558aba32209eb0bee457c13bc034df448857 100755
--- a/src/app/resource/controllers/ResController.php
+++ b/src/app/resource/controllers/ResController.php
@@ -182,9 +182,12 @@ class ResController
             return $response->withStatus(404)->withJson(['errors' => 'Document not found on docserver']);
         }
 
+        $finfo    = new \finfo(FILEINFO_MIME_TYPE);
+        $mimeType = $finfo->buffer($fileContent);
+
         $response->write($fileContent);
 
-        return $response->withHeader('Content-Type', FILEINFO_MIME_TYPE);
+        return $response->withHeader('Content-Type', $mimeType);
     }
 
     public function updateExternalInfos(Request $request, Response $response)
diff --git a/src/app/user/controllers/UserController.php b/src/app/user/controllers/UserController.php
index 4bfe7278569d3d051e0dbd19f0632c88a2ccc6c7..06b8b93b3eafaf620aadf61c6fba44e92844c092 100644
--- a/src/app/user/controllers/UserController.php
+++ b/src/app/user/controllers/UserController.php
@@ -482,9 +482,12 @@ class UserController
             return $response->withStatus(404)->withJson(['errors' => 'Signature not found on docserver']);
         }
 
+        $finfo    = new \finfo(FILEINFO_MIME_TYPE);
+        $mimeType = $finfo->buffer($image);
+
         $response->write($image);
 
-        return $response->withHeader('Content-Type', FILEINFO_MIME_TYPE);
+        return $response->withHeader('Content-Type', $mimeType);
     }
 
     public function addSignature(Request $request, Response $response, array $aArgs)