Project

General

Profile

Defect #10832 ยป rest-upload-fastcgi.patch

Jeffrey Clark, 2012-05-04 20:49

View differences:

app/models/attachment.rb
74 74

  
75 75
  def file=(incoming_file)
76 76
    unless incoming_file.nil?
77
      @temp_file = incoming_file
77
      if incoming_file.kind_of? Rack::RewindableInput
78
        @temp_file = StringIO.new(incoming_file.read.to_s)
79
        @temp_file.set_encoding(Encoding::BINARY) if @temp_file.respond_to?(:set_encoding)
80
      else
81
        @temp_file = incoming_file
82
      end
78 83
      if @temp_file.size > 0
79 84
        if @temp_file.respond_to?(:original_filename)
80 85
          self.filename = @temp_file.original_filename
    (1-1/1)