Auto-detect attachment content type when blank (#3782).

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@3258 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang
2009-12-29 13:28:30 +00:00
parent b7b4e27833
commit ff7eb7b23a
6 changed files with 46 additions and 4 deletions
+17 -2
View File
@@ -1,5 +1,5 @@
# redMine - project management software
# Copyright (C) 2006-2007 Jean-Philippe Lang
# Redmine - project management software
# Copyright (C) 2006-2009 Jean-Philippe Lang
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
@@ -36,6 +36,7 @@ module Redmine
'text/x-sh' => 'sh',
'text/xml' => 'xml,xsd,mxml',
'text/yaml' => 'yml,yaml',
'text/csv' => 'csv',
'image/gif' => 'gif',
'image/jpeg' => 'jpg,jpeg,jpe',
'image/png' => 'png',
@@ -43,6 +44,20 @@ module Redmine
'image/x-ms-bmp' => 'bmp',
'image/x-xpixmap' => 'xpm',
'application/pdf' => 'pdf',
'application/rtf' => 'rtf',
'application/msword' => 'doc',
'application/vnd.ms-excel' => 'xls',
'application/vnd.ms-powerpoint' => 'ppt,pps',
'application/vnd.openxmlformats-officedocument.wordprocessingml.document' => 'docx',
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' => 'xlsx',
'application/vnd.openxmlformats-officedocument.presentationml.presentation' => 'pptx',
'application/vnd.openxmlformats-officedocument.presentationml.slideshow' => 'ppsx',
'application/vnd.oasis.opendocument.spreadsheet' => 'ods',
'application/vnd.oasis.opendocument.text' => 'odt',
'application/vnd.oasis.opendocument.presentation' => 'odp',
'application/x-7z-compressed' => '7z',
'application/x-rar-compressed' => 'rar',
'application/x-tar' => 'tar',
'application/zip' => 'zip',
'application/x-gzip' => 'gz',
}.freeze
+1 -1
View File
@@ -128,7 +128,7 @@ namespace :redmine do
end
def content_type
Redmine::MimeType.of(filename) || ''
''
end
def exist?