上传图像在我的机器上运行良好,但在实时服务器上无法运行。
这是本地主机上的参数:
{"provider_source"=>{"photos_attributes"=>{"0"=>{"image"=>#<ActionDispatch::Http::UploadedFile:0xaa23410 @original_filename="som_statenisland_netzero_school.jpg", @content_type="image/jpeg", @headers="Content-Disposition: form-data; name=\"provider_source[photos_attributes][0][image]\"; filename=\"som_statenisland_netzero_school.jpg\"\r\nContent-Type: image/jpeg\r\n", @tempfile=#<File:/tmp/RackMultipart20121129-4550-xbzsif>>, "description"=>""}, "1"=>{"description"=>""}, "2"=>{"description"=>""}}}, "utf8"=>"✓", "authenticity_token"=>"6cMwEI4lZreocgiOyJRdDfh2cGMcs85i28mMdsEWvog=", "remotipart_submitted"=>"true", "X-Requested-With"=>"IFrame", "X-Http-Accept"=>"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript, */*; q=0.01"}
我在实时服务器上安装了图像魔法。
我在实时服务器上使用 nginx + Phusion Passenger 作为我的应用程序。
在 Live 服务器上,我选择一个图像并点击提交。图像参数始终为零。
这是我的 nginx 配置:
#user nobody;
worker_processes 1;
#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;
#pid logs/nginx.pid;
events {
worker_connections 1024;
}
http {
passenger_root /usr/local/rvm/gems/ruby-1.9.2-p180/gems/passenger-3.0.18;
passenger_ruby /usr/local/rvm/wrappers/ruby-1.9.2-p180/ruby;
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
server {
listen 80;
server_name localhost;
root /srv/www/rails/bbz_dev;
passenger_enabled on;
}
}
我不知道为什么会出现这个问题。我试图解决它 2 天,但我不能。请帮我解决这个问题。谢谢