diff --git a/tools/process_input_template.cpp b/tools/process_input_template.cpp
index 03bc2bd5f6..d9f3958e76 100644
--- a/tools/process_input_template.cpp
+++ b/tools/process_input_template.cpp
@@ -364,9 +364,16 @@ static int process_workunit(
bool found_file_number = false, found_open_name = false;
while (!xp.get_tag()) {
if (xp.parse_int("file_number", file_number)) {
- sprintf(buf, " %s\n",
- infiles[file_number].name
- );
+ INFILE_DESC& id = infiles[file_number];
+ if (id.is_remote) {
+ sprintf(buf, " jf_%s\n",
+ infiles[file_number].md5
+ );
+ } else {
+ sprintf(buf, " %s\n",
+ infiles[file_number].name
+ );
+ }
out += buf;
found_file_number = true;
continue;