Change in document wrapper to download files in bittorrent directory

This commit is contained in:
Laurent Destailleur 2009-02-24 22:52:55 +00:00
parent 6a0877fe6a
commit b84a0fefbe
2 changed files with 17 additions and 14 deletions

View File

@ -398,7 +398,9 @@ if ($modulepart)
if ($modulepart == 'bittorrent')
{
$accessallowed=1;
$original_file=DOL_DATA_ROOT.'/bittorrent/files/'.$original_file;
$dir='files';
if ($type == 'application/x-bittorrent') $dir='torrents';
$original_file=DOL_DATA_ROOT.'/bittorrent/'.$dir.'/'.$original_file;
$sqlprotectagainstexternals = '';
}
}

View File

@ -176,6 +176,7 @@ function dol_mimetype($file)
if (eregi('\.tiff$',$file)) $mime='image/tiff';
if (eregi('\.vcs$',$file)) $mime='text/calendar';
if (eregi('\.ics$',$file)) $mime='text/calendar';
if (eregi('\.torrent$',$file)) $mime='application/x-bittorrent';
if (eregi('\.(mp3|ogg|au)$',$file)) $mime='audio';
if (eregi('\.(avi|mvw|divx|xvid)$',$file)) $mime='video';
if (eregi('\.(zip|rar|gz|tgz|z|cab|bz2)$',$file)) $mime='archive';