lib/nsisam/client.rb in nsisam-0.6.0 vs lib/nsisam/client.rb in nsisam-0.6.1

- old
+ new

@@ -52,12 +52,12 @@ # @raise [NSISam::Errors::Client::AuthenticationError] when user and password doesn't match # # @example # nsisam.store_file(File.read("foo.txt")) # nsisam.store_file(File.read("foo.txt"), :video) - def store_file(file_content, type=:file) - store(type => Base64.encode64(file_content)) + def store_file(file_content, filename, type=:file) + store(type => Base64.encode64(file_content), :filename => filename) end # Delete data at a given SAM key # # @param [Sring] key of the value to delete @@ -111,10 +111,11 @@ def get_file(key, type=:file, expected_checksum = nil) response = get(key, expected_checksum) Response.new( 'key' => response.key, 'checksum' => response.checksum, - 'data' => Base64.decode64(response.data[type.to_s]), + 'filename' => response.data['filename'], + 'file' => Base64.decode64(response.data[type.to_s]), 'deleted' => response.deleted?) end # Update data stored at a given SAM key #