有编码转换错误时,不进行转码

This commit is contained in:
z9hang 2014-10-24 09:41:31 +08:00
parent 84e8a40174
commit 9723d62d16
1 changed files with 2 additions and 0 deletions

View File

@ -56,6 +56,8 @@ class AttachmentsController < ApplicationController
}
format.api
end
rescue Encoding::InvalidByteSequenceError => e
render :action => 'file'
end
def download