Content-Disposition
をdocxファイルにs3で追加しようとしています。次の行に沿って何か:Content-Disposition: attachment; filename="filename.docx"
。 IE(< 9)がzipファイルとしてdocxファイルをダウンロードするので、私はこれをしたいと思います。いくつかのグーグルで私は、これに対処方法があることを発見しました。コンテンツにcontent-disposition
を追加しました。私はそれはまだzipファイルとしてダウンロードし、バックbefore_post_process
コールを使用してみましたし、ペーパークリップを使用してdocxのコンテンツ設定を設定する
before_post_process :set_content_disposition
def set_content_disposition
filename = self.attachment.instance.attachment_file_name
self.attachment.instance_write(:content_disposition, "attachment; filename="+filename)
end
をしました。しかし。これを正しく行う方法はありますか?
これは '.merge! 'でなければなりません –