Help: How do I read data from CGI#multipart_form?

Hi:

I am trying to create a file upload web page using CGI and webrick.
I create a file upload form using CGI#multipart_form and get
back an Array containing two Tempfiles, one containing the filename
and one containing the contents of the file. However, I cannot seem
to access the Tempfile containing the value without getting a few garbage
characters at the beginning. This only happens on larger files.

Can someone tell me what I need to do to correctly read the
Tempfile data.

Thanks

multipart_form(ENV["SCRIPT_NAME"]){
  '<input name="filename" value="val" size="30" type="file">' +
  submit("Uploadval","Uploadname")
  }
···


Jim Freeze