my $tmp_file_name = $_FILES{Filedata}{tmp_name}; my $ok = move_uploaded_file($tmp_file_name, '/path_to/new_filename'); print $ok ? "OK" : "FAIL";