From ecf8fe1e933fbb3ce5c9fc82259d913a9b941e1d Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Mon, 4 May 2009 11:25:59 +0000 Subject: [PATCH] Das Modul SL/MIME.pm zum Commit Revision 3987. --- SL/MIME.pm | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 SL/MIME.pm 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; -- 2.20.1