Issue with S3Object.store

Subscribe to Issue with S3Object.store 2 posts, 2 voices

 
Avatar Shpigford 30 posts
@videothumb = HeyWatch::EncodedVideo.find(284387).thumbnail :start => 2, :width => 640, :height => 480

S3Object.store(
  "video/#{@item.id}/#{@item.key}.jpg",
  File.open(@videothumb, "wb"),
  "bucket",
  :access => :public_read_write
)

That throws this error on the File.open(@videothumb, "wb") line:

A IOError occurred in ping#encode:

 not opened for reading
 /usr/lib/ruby/gems/1.8/gems/aws-s3-0.4.0/lib/aws/s3/extensions.rb:290:in `read'
 
Avatar Bruno Celeste 374 posts

It’s File.open(@videothumb, “r”)

You opened the file to write.