in reply to File Upload through a form

Please elaborate on what exactly you're having problems when. Posting a partial code snippet and saying "it doesn't work" doesn't allow us to help you at all. The CGI documentation has a complete section with examples on doing file uploads, as well as a few caveats, one of which is probably your problem.

If you're still having problems, explain what is wrong, what is happening, and show us how you're building your HTML form.