4
我不知道如何设置内容长度send_file
。如何通过send_file设置内容长度
我检查了API,没有内容长度参数。关于响应对象,你可以找到official docs
def download
@file = Attachment.find params[:id]
response.headers['Content-Length'] = @file.size.to_s
send_file @file.path, :x_sendfile => true
end
更多信息:
谢谢你!但我得到了一个错误502:坏的网关/ nginx/1.4.1, 我现在无法上传图片,对不起 –
您是从应用程序上传还是下载图片? – rastasheep
正在下载生成的zip文件,我正在使用nginx,是rails还是nginx配置错误? –