views:

783

answers:

4

Anyone got a working example of using ruby to post to a presigned URL on s3

A: 

Does anything on the s3 library page cover what you need? There are loads of examples there.

Dan Harper - Leopard CRM
Unfortunately not. And the RUBY S3 Gems don;t support the signed urls
+1  A: 

Can you provide more information on how a "presigned URL" works? Is it like this:

AWS::S3::S3Object.url_for(self.full_filename,
                          self.bucket_name, {
                            :use_ssl => true,
                            :expires_in => ttl_seconds
                          })

I use this code to send authenticated clients the URL to their S3 file. I believe this is the "presigned URL" that you're asking about. I haven't used this code for a PUT, so I'm not exactly sure if it's right for you, but it might get you close.

Dan Harper - Leopard CRM
A: 

I've managed to sort it out. Turns out the HTTP:Net in Ruby is has some short comings. Lot of Monkeypatch later I got it working.. More details when I have time. thank

Provide the solution then. Otherwise Stack Overflow doesn't work. :)
Till
I agree! Post it!
Blaine
A: 

There are some generic REST libraries for Ruby; Google for "ruby rest client". See also HTTParty.

Pistos