added a file to fix wrong recognised mime-types
This commit is contained in:
parent
9e105d9bd7
commit
a0ff21a232
|
@ -132,6 +132,13 @@ class OC_Filestorage_Local extends OC_Filestorage{
|
||||||
public function getMimeType($fspath){
|
public function getMimeType($fspath){
|
||||||
if($this->is_readable($fspath)){
|
if($this->is_readable($fspath)){
|
||||||
$mimeType='application/octet-stream';
|
$mimeType='application/octet-stream';
|
||||||
|
if ($mimeType=='application/octet-stream') {
|
||||||
|
self::$mimetypes = include('mimetypes.fixlist.php');
|
||||||
|
$extention=strtolower(strrchr(basename($fspath), "."));
|
||||||
|
$extention=substr($extention,1);//remove leading .
|
||||||
|
$mimeType=(isset(self::$mimetypes[$extention]))?self::$mimetypes[$extention]:'application/octet-stream';
|
||||||
|
|
||||||
|
}
|
||||||
if (@is_dir($this->datadir.$fspath)) {
|
if (@is_dir($this->datadir.$fspath)) {
|
||||||
// directories are easy
|
// directories are easy
|
||||||
return "httpd/unix-directory";
|
return "httpd/unix-directory";
|
||||||
|
@ -158,7 +165,7 @@ class OC_Filestorage_Local extends OC_Filestorage{
|
||||||
}
|
}
|
||||||
if ($mimeType=='application/octet-stream') {
|
if ($mimeType=='application/octet-stream') {
|
||||||
// Fallback solution: (try to guess the type by the file extension
|
// Fallback solution: (try to guess the type by the file extension
|
||||||
if(!self::$mimetypes){
|
if(!self::$mimetypes || self::$mimetypes == include('mimetypes.list.php')){
|
||||||
self::$mimetypes=include('mimetypes.list.php');
|
self::$mimetypes=include('mimetypes.list.php');
|
||||||
}
|
}
|
||||||
$extention=strtolower(strrchr(basename($fspath), "."));
|
$extention=strtolower(strrchr(basename($fspath), "."));
|
||||||
|
|
|
@ -0,0 +1,12 @@
|
||||||
|
<?php
|
||||||
|
return array(
|
||||||
|
'ics'=>'text/calendar',
|
||||||
|
'ical'=>'text/calendar',
|
||||||
|
'js'=>'application/javascript',
|
||||||
|
'odt'=>'application/vnd.oasis.opendocument.text',
|
||||||
|
'ods'=>'application/vnd.oasis.opendocument.spreadsheet',
|
||||||
|
'odg'=>'application/vnd.oasis.opendocument.graphics',
|
||||||
|
'odp'=>'application/vnd.oasis.opendocument.presentation',
|
||||||
|
'pl'=>'text/x-script.perl',
|
||||||
|
'py'=>'text/x-script.phyton',
|
||||||
|
);
|
Loading…
Reference in New Issue