Check where the while loop closing brace is, because in the code posted, it looks to be at incorrect position.
Only below part should be in while loop:
fileContents = fileContents + "\n" +...
Type: Posts; User: tombstone
Check where the while loop closing brace is, because in the code posted, it looks to be at incorrect position.
Only below part should be in while loop:
fileContents = fileContents + "\n" +...