ruby on rails - AWS S3 using s3_direct_upload Gem appears to process but nothing is uploaded to my s3 bucket -


i had followed given instructions using s3_direct_upload gem. when submit upload form attached image new 'upload' item created no image sent s3 (or display).

i have user.rb model through devise model i'm using images upload.rb.

here logs i'm getting in development mode when submitting image form. can see nothing appended new 'upload' item except creation date , id (everything else nil). side note - should seeing bucket name in here log (i don't)?

additional info: in s3 console, removed bucket. still same output below. so, seems it's not sending info out s3? ideas cause that?

started post "/uploads" 127.0.0.1 @ 2013-05-12 19:10:52 -0400 processing uploadscontroller#create / parameters: {"utf8"=>"√", "key"=>"uploads/1368400251964-ol9ja4ijq0110pb9-bf206 97a98bbff7c58a83d7bfaa84800/${filename}", "acl"=>"public-read", "awsaccesskeyid" =>"akiai2exmfcutiligg", "policy"=>"eyjlehbpcmf0aw9uijoimjaxmy0wns0xm1qwotoxmdo 0n1oilcjjb25kaxrpb25zijpbwyjzdgfydhmtd2l0acisiir1dgy4iiwiil0swyjzdgfydhmtd2l0aci siirrzxkilcj1cgxvywrzlyjdlfsic3rhcnrzlxdpdggilcikec1yzxf1zxn0zwqtd2l0acisiijdlfs iy29udgvudc1szw5ndggtcmfuz2uildasnti0mjg4mdawxsxbinn0yxj0cy13axroiiwijgnvbnrlbnq tdhlwzsisiijdlhsiynvja2v0ijoibgl2zxblcmnoin0seyjhy2wioijwdwjsawmtcmvhzcj9lhsic3v jy2vzc19hy3rpb25fc3rhdhvzijoimjaxin1dfq==", "signature"=>"f9r5qelx4nllekug805cv1 ojtu0=", "success_action_status"=>"201", "x-requested-with"=>"xhr", "content-typ e"=>"image/jpeg", "file"=>#>} ←[1m←[36muser load (1.0ms)←[0m ←[1mselect "users".* "users" "users"."id" = 1 limit 1←[0m ←[1m←[35m (0.0ms)←[0m begin
←[1m←[36msql (81.0ms)←[0m ←[1minsert "uploads" ("created_at", "image_url", "name", "product_id", "updated_at") values ($1, $2, $3, $4, $5) returning "id"←[0m [["created_at", sun, 12 may 2013 23:10:52 utc +00:00], ["image_url", nil] , ["name", nil], ["product_id", nil], ["updated_at", sun, 12 may 2013 23:10:52 utc +00:00]] ←[1m←[35m (18.0ms)←[0m commit rendered uploads/_upload.html.erb (1.0ms)
rendered uploads/create.js.erb (4.0ms) completed 200 ok in 127ms (views: 22.0ms | activerecord: 101.0ms)

here mu upload.rb model.

 class upload < activerecord::base   attr_accessible :image_url, :name, :product_id   before_create :default_name    def default_name     self.name ||= file.basename(image_url, '.*').titleize if image_url    end   end 

here image form code triggers send s3.

 <%= s3_uploader_form callback_url: uploads_url, callback_param: upload[image_url]", id: "mys3uploader" %>   <%= file_field_tag :file, multiple: true %> <% end %> 

here initializer file gem requires houses s3 information. edited keys , bucket name out.

s3directupload.config |c|       c.access_key_id = "aws_key"       # access key id       c.secret_access_key = "aws_secret_key"   # secret access key       c.bucket = "aws_bucket_name"              # bucket name       c.region = ""              # region prefix of bucket url (optional), eg. "s3-eu-west-1"       c.url = ""                 # s3 api endpoint (optional), eg. "https://#{c.bucket}.s3.amazonaws.com/"     end 

and, here create.js.erb file model

<% if @upload.new_record? %>   alert("failed upload: <%= j @upload.errors.full_messages.join(', ').html_safe %>"); <% else %>   $("#uploads").append("<%= j render(@upload) %>"); <% end %> 

i little new rails , has been driving me nuts. appreciate help!

you should try removing configuration url , region blank strings , set them nil or omit them.


Comments

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -