lib/property/parse_file.rb in dm-parse-0.3.17 vs lib/property/parse_file.rb in dm-parse-0.3.18
- old
+ new
@@ -17,10 +17,10 @@
end
def typecast(value)
if value.respond_to?(:original_filename) && value.respond_to?(:read) && value.respond_to?(:content_type)
adapter = model.repository.adapter
- filename = value.original_filename
+ filename = Digest::SHA256.new.hexdigest value.original_filename
content = value.read
content_type = value.content_type
response = adapter.upload_file(filename, content, content_type)
URI(response["url"])
elsif value.is_a?(::Hash)