Without knowing how your directory/ies is/are setup, I can only guess at possible solutions.
You can use [man]glob/man to search a directory, i.e. "john*.txt" will return "johnsmith.txt", "johndoe.txt", etc.
If you KNOW what the file should be, i.e. "johndoe.txt", then use [man]is_file[/man] to check that it exists.
By now, you should have found a suitable function to search for the file you need and verify it exists; if not, you should have outputted an error and killed the script. What we need to do now is force the person's browser to download the file (by force, I mean pop up the Download File box). We can accomplish this using a set of headers like so:
header ("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header ("Content-Type: application/octet-stream");
header ("Content-Length: " . filesize('/path/to/directory/with/files/' . $username . '.txt'));
header ("Content-Disposition: attachment; filename=\"" . $username . ".txt\"");
Now, you can output the file's contents using [man]fpassthru/man, [man]readfile/man, etc.
Does this answer your question? Are the usernames in the file names, or in the files themselves? Again - I don't know how your site is structured, so I'm just guessing here.