File Upload Problem

works fine with webbrick

but when running through dispatch.cgi or .fcgi it fails with this error:

malformed header from script. Bad header=image/jpeg:
/home/emh/phocab.com/public/dispatch.cgi

or if using fastcgi:

FastCGI: comm with server “/home/emh/phocab.com/public/dispatch.fcgi”
aborted: error parsing headers: malformed header ‘image/jpeg’

i repeat, it works fine with webbrick

here is my html:

<%= form_tag({:controller => ‘phocab’, :action => ‘submit_photo’},
{:multipart => true}) %>
<%= select(“photo”, “word_id”, @words) %>

<%= file_field(“photo”, “photo”) %>

<%= submit_tag “submit” %>
<%= end_form_tag %>

any ideas?

i am hosting my site with dreamhost if that helps…

argh, another hour of searching and i discover that fastcgi chokes if
your code has any puts statements…