epic-s6ts
[kivitendo-erp.git] / SL / MIME.pm
1 package SL::MIME;
2
3 use strict;
4
5 sub mime_type_from_ext {
6   $main::lxdebug->enter_sub();
7
8   my $self = shift;
9   my $ext  = shift;
10
11   # TODO: Mittels Standardmodulen implementieren.
12   my %mime_types = ('ods'  => 'application/vnd.oasis.opendocument.spreadsheet',
13                     'odt'  => 'application/vnd.oasis.opendocument.text',
14                     'pdf'  => 'application/pdf',
15                     'sql'  => 'text/plain',
16                     'txt'  => 'text/plain',
17                     'html' => 'text/html',
18     );
19
20   $ext =~ s/.*\.//;
21
22   $main::lxdebug->leave_sub();
23
24   return $mime_types{$ext};
25 }
26
27 1;