lib/attached/storage/aws.rb in attached-0.2.8 vs lib/attached/storage/aws.rb in attached-0.2.9

- old
+ new

@@ -54,15 +54,13 @@ # # * file - The file to save. # * path - The path to save. def save(file, path) - file = File.open(file.path) - directory = connection.directories.get(self.bucket) directory ||= connection.directories.create(self.permissions.merge(:key => self.bucket)) - directory.files.create(self.permissions.merge(:body => file, :key => path)) + directory.files.create(self.options(path).merge(self.permissions.merge(:key => path, :body => file.read))) end # Destroy a file at a given path. # \ No newline at end of file