How mongrel temporary file is converted to cgi temp files

Hii all,
Does anyone know how mongrel temp files are converted to cgi
file while doing large file upload???I mean mongrel temp files are
created in mongrel http_request.rb but these file are converted in cgi
file??