in reply to CGI file upload - endless loop??

It may be that your not posting to your script. Try...
<form name="upload" method="post" action="http://www.your_domain.com/ +cgi-bin/newimage.cgi" enctype="multipart/form-data">


Also, posting some more of the relevant code may help.