generalization file type

This commit is contained in:
Rueshyna 2013-01-02 16:58:48 +08:00
parent f4692182c0
commit 5f7453c3fb
1 changed files with 2 additions and 2 deletions

View File

@ -38,8 +38,8 @@ module Panel::Announcement::BackEnd::BulletinsHelper
def file_picture_preview_setting(file_path) def file_picture_preview_setting(file_path)
res= "" res= ""
ext = File.extname(file_path)[1..-1] #ext = File.extname(file_path)
puts ext ext = MIME::Types.type_for(file_path).first.to_s.split("/")[1]
unless file_path.nil? unless file_path.nil?
case ext case ext
when "jpg","jpeg","png","gif" when "jpg","jpeg","png","gif"