By utilizing a new feature of the upload method this process can be simplified to: $ok = $q->upload( $q->param('upload_file1'), '/path/to/write/file.name' ); if ($ok) { print "Uploaded and wrote file OK!"; } else { print $q->cgi_error(); } As you can see upload will accept an optional second argument and will write the file to this file path. It will return 1 for success and undef if it fails. If it fails you can get the error from cgi_error.