# File lib/parts.rb, line 40 def initialize(boundary, name, io) file_length = io.respond_to?(:length) ? io.length : File.size(io.local_path) @head = build_head(boundary, name, io.original_filename, io.content_type, file_length, io.respond_to?(:opts) ? io.opts : {}) @foot = "\r\n" @length = @head.length + file_length + @foot.length @io = CompositeReadIO.new(StringIO.new(@head), io, StringIO.new(@foot)) end