Rails 4 Dragonfly Gem with Amazon S3 Direct Upload -


i'm trying figure out how incorporate s3 dragonfly. gem works locally, because i'm using heroku, files gets deleted... so, i'm thinking need implement s3.

i'm using gem: dragonfly-s3_data_store dragonfly.rb looks this:

/config/initializers/dragonfly.rb

require 'dragonfly' require 'dragonfly/s3_data_store'  # configure dragonfly.app.configure   plugin :imagemagick    url_format "/media/:job/:name"    datastore :s3,     bucket_name: 'thelab',     access_key_id: '{my access key}',     secret_access_key: '{my secret key}',     region: "us-west-1" end  ... #more code 

this error when i'm trying upload image:

hostname "thelab.thelab.s3-us-west-1.amazonaws.com" not match server certificate (openssl::ssl::sslerror) 

i'm not sure what's causing issue, on console, see popping up:

[fog][warning] fog: followed redirect thelab.s3-us-west-2.amazonaws.com, connecting matching region more performant 

there's inconsistency here... i've tried switch region us-west-2, still same errors , warning signs.

form:

= simple_form_for(resource, as: resource_name, url: registration_path(resource_name), html: { method: :put }) |f|   = f.file_field :image   = f.button :submit, "save changes" 

and of course, model, in case user.rb, has this:

dragonfly_accessor :image 

am missing else needs configured?

also, cors configuration thelab bucket

<corsconfiguration>     <corsrule>         <allowedorigin>*</allowedorigin>         <allowedmethod>get</allowedmethod>         <maxageseconds>3000</maxageseconds>         <allowedheader>authorization</allowedheader>     </corsrule> </corsconfiguration> 


Comments

Popular posts from this blog

ios - UITEXTFIELD InputView Uipicker not working in swift -

Hatching array of circles in AutoCAD using c# -