From: Moritz Bunkus Date: Mon, 4 May 2009 11:25:59 +0000 (+0000) Subject: Das Modul SL/MIME.pm zum Commit Revision 3987. X-Git-Tag: release-2.6.0beta2~84 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=ecf8fe1e933fbb3ce5c9fc82259d913a9b941e1d;p=kivitendo-erp.git Das Modul SL/MIME.pm zum Commit Revision 3987. --- diff --git a/SL/MIME.pm b/SL/MIME.pm new file mode 100644 index 000000000..9edfe0d0e --- /dev/null +++ b/SL/MIME.pm @@ -0,0 +1,25 @@ +package SL::MIME; + +sub mime_type_from_ext { + $main::lxdebug->enter_sub(); + + my $self = shift; + my $ext = shift; + + # TODO: Mittels Standardmodulen implementieren. + my %mime_types = ('ods' => 'application/vnd.oasis.opendocument.spreadsheet', + 'odt' => 'application/vnd.oasis.opendocument.text', + 'pdf' => 'application/pdf', + 'sql' => 'text/plain', + 'txt' => 'text/plain', + 'html' => 'text/html', + ); + + $ext =~ s/.*\.//; + + $main::lxdebug->leave_sub(); + + return $mime_types{$ext}; +} + +1;