Defect #10832 ยป rest-upload-fastcgi.patch
| app/models/attachment.rb | ||
|---|---|---|
|
def file=(incoming_file)
|
||
|
unless incoming_file.nil?
|
||
|
@temp_file = incoming_file
|
||
|
if incoming_file.kind_of? Rack::RewindableInput
|
||
|
@temp_file = StringIO.new(incoming_file.read.to_s)
|
||
|
@temp_file.set_encoding(Encoding::BINARY) if @temp_file.respond_to?(:set_encoding)
|
||
|
else
|
||
|
@temp_file = incoming_file
|
||
|
end
|
||
|
if @temp_file.size > 0
|
||
|
if @temp_file.respond_to?(:original_filename)
|
||
|
self.filename = @temp_file.original_filename
|
||