Rails RAILS 中 如何上传超过 200M~300M 的文件?

suffering · March 13, 2012 · Last by suffering replied at March 13, 2012 · 3559 hits

配置: LINUX UBUNTU 10.04 (Linode VPS) NGINX PASSENGER RUBY 1.9.3 RAILS 3.2.1 其中,nginx 的配置基本保持默认状态。

相关代码: Gemfile: gem 'mongoid' gem 'paperclip_mongoid' Model: class Support include Mongoid::Document include Mongoid::Paperclip validates_attachment_size :download, :less_than => 300.megabytes validates_attachment_presence :download end 这样的配置,在本地时上传文件没有问题。但是在服务器上之后,20M 的文件都没能成功上传过一个。

client_max_body_size?

改 nginx 设置 client_max_body_size 50m; keepalive_timeout 300;

#2 楼 @ywencn ,Thank you ,应该就是这里的问题了。 美国的 VPS 主机,上传平均 150M 的文件,还是通过浏览器,真是蛋疼啊。

You need to Sign in before reply, if you don't have an account, please Sign up first.