蔭嘗試添加Content-Disposition
我的docx文件在S3中的docx。沿線的東西:Content-Disposition: attachment; filename="filename.docx"
。我想這樣做是因爲IE(< 9)將docx文件下載爲zip文件。經過一些Google搜索後,我發現有一個解決方法,在內容中加入content-disposition
。我嘗試使用before_post_process
回電,做設置內容處置使用回形針
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
但是,它仍然是下載的zip文件。有沒有辦法正確做到這一點。
這應該是'.merge' –