require 'rubygems' require 'image_science' …… def upload_file=(file_field) if !file_field || file_field == '' self.destroy else self.name = base_part_of(file_field.original_filename) self.content_type = file_field.content_type.chomp if file_field.kind_of? StringIO work_file = "/tmp/#{self.name}" File.open(work_file, 'w') do |f| f.write file_field.read end else work_file = file_field.path end Image