Skip to content
Snippets Groups Projects
Commit 964d0a80 authored by Giovannoni Laurent's avatar Giovannoni Laurent
Browse files

FIX #3024

parent 8a5c26ee
Branches
Tags
No related merge requests found
...@@ -477,7 +477,7 @@ function Ds_setRights($dest) ...@@ -477,7 +477,7 @@ function Ds_setRights($dest)
} }
/** /**
* get the mime type of a doc * get the mime type of a file with a path
* @param $filePath path of the file * @param $filePath path of the file
* @return string of the mime type * @return string of the mime type
*/ */
...@@ -487,6 +487,17 @@ function Ds_getMimeType($filePath) ...@@ -487,6 +487,17 @@ function Ds_getMimeType($filePath)
return MIME_Type::autoDetect($filePath); return MIME_Type::autoDetect($filePath);
} }
/**
* get the mime type of a file with a buffer
* @param $fileBuffer buffer of the file
* @return string of the mime type
*/
function Ds_getMimeTypeWithBuffer($fileBuffer)
{
$finfo = new finfo(FILEINFO_MIME);
return $finfo->buffer($fileBuffer);
}
/** /**
* del tmp files * del tmp files
* @param $dir dir to wash * @param $dir dir to wash
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment