取消 Rails/Spree 图片上传限制?
我的客户今天打电话来,因为他们无法将图像上传到他们的购物网站,而且我完全不知道上传文件大小限制是在哪里配置的。
这是我的服务器配置:Ubuntu 10.04LTS、Spree on Rails 2.3、Nginx。
基本上我想删除文件大小上传限制。
有人知道我应该从哪里开始吗?
My client called today because they couldn't upload their images to their shopping site, and I have absolutely no idea where the upload file size limits are configured.
So here's my server configuration: Ubuntu 10.04LTS, Spree on Rails 2.3, Nginx.
Basically I want to remove the file-size upload limit.
Anyone know where I should go to get started?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
你检查过你的 Nginx 配置了吗?
更具体地说, client_max_body_size 指令?
为了确保您的 Spree 安装不会拒绝该文件,请在本地启动
script/server
并尝试向其中上传一个大文件。Have you checked your Nginx config?
More specifically the client_max_body_size directive?
To make sure your Spree install is not rejecting the file, fire up
script/server
locally and try uploading a big file to it.Spree 使用 Paperclip (http://github.com/thoughtbot/paperclip) 进行图像处理和管理。您还可以检查那里的大小限制。
Spree uses Paperclip (http://github.com/thoughtbot/paperclip) for it's image processing and management. You might also check there for a size limit.
请务必查看 spree 用户 google 群组,了解与 Spree 相关的问题。您可能会在那里得到更快的回复。
Be sure to also checkout spree-user google group for Spree-related questions. You might get a faster response there.
那么您真的希望您的客户将他们的 DSLR 中的 18 兆像素图像直接上传到网站吗?或者,您是否问过他们要上传的图像有多大?正如其他人已经说过的,有几个地方可以限制文件大小。此外,图像文件可能会被编码,因此限制可能比您预期的要低得多。
So you really want your client to upload their 18 megapixel images from their DSLR directly to the site? Or, did you ask them how large the images are they want to upload? As others already said, there are several places where file size can be limited. In addition, the image files might be encoded, so the limit can be much lower than you'd expect.