Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/heroku/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
上传舒适的墨西哥沙发cms图像';s从s3桶到heroku_Heroku_Amazon S3_Ruby On Rails 4.1_Comfortable Mexican Sofa - Fatal编程技术网

上传舒适的墨西哥沙发cms图像';s从s3桶到heroku

上传舒适的墨西哥沙发cms图像';s从s3桶到heroku,heroku,amazon-s3,ruby-on-rails-4.1,comfortable-mexican-sofa,Heroku,Amazon S3,Ruby On Rails 4.1,Comfortable Mexican Sofa,我已经成功地将舒适的墨西哥沙发CMS集成到现有的rails 4.1.2应用程序中 现在我想从s3 bucket上传图像到heroku 有人能告诉我具体步骤吗?沙发使用回形针作为附件。首先,请看这里: 然后在initializers/costful\u mexican\u sofa.rb中可以找到config.upload\u file\u选项。这就是您将覆盖默认值的方式 config.upload_file_options = { :storage => :s3, :

我已经成功地将舒适的墨西哥沙发CMS集成到现有的rails 4.1.2应用程序中

现在我想从s3 bucket上传图像到heroku


有人能告诉我具体步骤吗?

沙发使用回形针作为附件。首先,请看这里:

然后在
initializers/costful\u mexican\u sofa.rb
中可以找到
config.upload\u file\u选项。这就是您将覆盖默认值的方式

config.upload_file_options = {
  :storage        => :s3,
  :s3_credentials => ...
}
在config.upload\u file\u选项中提供样式,该选项将采用图像的精确大小

这在上传图像时更有意义,否则图像像素可能会有所不同

可用配置参数在曲别针中定义,不舒适,有关其含义的更多信息,请访问:


谢谢。。。。。。。。。。通过s3 bucket Decese上传到heroku的图像质量到localhost您能告诉我如何更改其原始图像质量看看这里:它提到了如何控制缩略图质量。我自己从没试过谢谢你的指导。。请不要介意我只是这样做:styles=>{:medium=>“300x300>”,:thumb=>“100x100>”}这就是你说的
config.upload_file_options = {
  :whiny => false,
  :storage => :s3,
  :s3_credentials => {"access_key_id" => ENV["S3_ACCESS_KEY_ID"], "secret_access_key" => ENV["S3_SECRET_ACCESS_KEY"]},
  :bucket => ENV["S3_BUCKET_NAME"], 
  :s3_host_name => 's3 HOST NAME',
  :path => "uploaded_files/:basename.:extension",
  :styles => {:thumb => "850x850>" }
  }