As Justin said, you need to be able to upload the local file via an HTTP POST. You can use 'curl' to do this. The following seems to work. It calls curl, collects the results in a temporary file, and then opens that file.
curl -o /tmp/`id -u`/results.html -F uploaded_file=@$TM_FILEPATH;type=text/html http://validator.w3.org/check && open /tmp/`id -u`/results.html