Method: CloudCrowd::AssetStore::S3Store#save

Defined in:
lib/cloud_crowd/asset_store/s3_store.rb

#save(local_path, save_path) ⇒ Object

Save a finished file from local storage to S3. Save it publicly unless we’re configured to use S3 authentication. Authenticated links expire after one day by default.



24
25
26
27
28
29
30
31
32
# File 'lib/cloud_crowd/asset_store/s3_store.rb', line 24

def save(local_path, save_path)
  if @use_auth
    @bucket.put(save_path, File.open(local_path), {}, 'private')
    @s3.interface.get_link(@bucket, save_path)
  else
    @bucket.put(save_path, File.open(local_path), {}, 'public-read')
    @bucket.key(save_path).public_link
  end
end