OK ... I don't think the 'refresh' problem will arise.
The steps will be as follows:
A script that uploads the text file to a named directory on the server. This has already been written. This cgi script will then (hopefully) point to this script which will then call the external program.
The results of the external program will come though as a text file also.