I've gotten that error before when my HTML form wasn't set up correctly. View the source of your form after it prints and make sure the form tag has the type="multipart/form-data" in it. I know you are using CGI and its supposed to that but make sure because the errors you are describing point that direction.