How mongrel Temorary files is generated

Hii all ,

mongrel1.1.2
ruby 1.8.6
apche 2.2.16

i am running Apche frontend to mongrel and trying to upload some large
file(from rails application) to filesystem.Few things i observed.

1 - The uploaded data is stored in a file "mongrel.4124.0"
2 - the mongrel file is copied to a CGI.4124.0 file (I suppose this is
the regular Ruby tempfile)
3 - the tempfile is copied to the right location where we mention in
code.

I would like which file in mongrel is responsible for generating
mongrel.4124.0
and hows it is garbase collected after upload??