Method: AWS::S3::S3Object#url_for
- Defined in:
- lib/aws/s3/s3_object.rb
#url_for(method, options = {}) ⇒ URI::HTTP, URI::HTTPS
Generates a presigned URL for an operation on this object. This URL can be used by a regular HTTP client to perform the desired operation without credentials and without changing the permissions of the object.
657 658 659 660 661 662 663 664 665 666 667 |
# File 'lib/aws/s3/s3_object.rb', line 657 def url_for(method, = {}) req = request_for_signing() method = http_method(method) expires = ([:expires]) req.add_param("AWSAccessKeyId", config.signer.access_key_id) req.add_param("Signature", signature(method, expires, req)) req.add_param("Expires", expires) build_uri([:secure] != false, req) end |