Class | Fog::Storage::AWS::File
In: | lib/fog/aws/models/storage/file.rb
Parent: | Fog::Model

### Methods

acl= body body= copy destroy directory metadata metadata= owner= public= public_url save url versions

### Attributes

body | [W] |
multipart_chunk_size | [RW] | @note Chunk size to use for multipart uploads.
        Use small chunk sizes to minimize memory. E.g. 5242880 = 5mb

### Public Instance methods

acl=(new_acl)

Set file‘s access control list (ACL).

        valid acls: private, public-read, public-read-write, authenticated-read

@param [String] new_acl one of valid options @return [String] @acl

body()

Get file‘s body if exists, else ’ ’.

@return [File]

body=(new_body)

Set body attribute.

@param [File] new_body @return [File] attributes[:body]

copy(target_directory_key, target_file_key, options = {})

Copy object from one bucket to other bucket.

        required attributes: directory, key

@param target_directory_key [String] @param target_file_key [String] @param options [Hash] options for copy_object method @return [String] Fog::AWS::Files#head status of directory contents

destroy(options = {})

Destroy file via http DELETE.

        required attributes: directory, key

@param options [Hash] @option options versionId [] @return [Boolean] true if successful

directory()

Get the file instance‘s directory.

@return [Fog::AWS::Storage::Directory]

metadata()
metadata=(new_metadata)
owner=(new_owner)
public=(new_public)

Set Access-Control-List permissions.

        valid new_publics: public_read, private

@param [String] new_public @return [String] new_puplic

public_url()

Get pubically acessible url via http GET. Checks persmissions before creating. Defaults to s3 subdomain or compliant bucket name

        required attributes: directory, key

@return [String] public url

save(options = {})

Save file with body as contents to directory.key with name key via http PUT

      required attributes: body, directory, key

@param [Hash] options @option options [String] acl sets x-amz-acl HTTP header. Valid values include, private | public-read | public-read-write | authenticated-read | bucket-owner-read | bucket-owner-full-control @option options [String] cache_controle sets Cache-Control header. For example, ‘No-cache’ @option options [String] content_disposition sets Content-Disposition HTTP header. For exampple, ‘attachment; filename=testing.txt’ @option options [String] content_encoding sets Content-Encoding HTTP header. For example, ‘x-gzip’ @option options [String] content_md5 sets Content-MD5. For example, ‘79054025255fb1a26e4bc422aef54eb4’ @option options [String] content_type Content-Type. For example, ‘text/plain’ @option options [String] expires sets number of seconds before AWS Object expires. @option options [String] storage_class sets x-amz-storage-class HTTP header. Defaults to ‘STANDARD’. Or, ‘REDUCED_REDUNDANCY’ @option options [String] encryption sets HTTP encryption header. Set to ‘AES256’ to encrypt files at rest on S3 @return [Boolean] true if no errors

url(expires, options = {})

Get a url for file.

        required attributes: key

@param expires [String] number of seconds before url expires @param options [Hash] @return [String] url

versions()

File version if exists or creates new version. @return [Fog::Storage::AWS::Version]

[Validate]