Hi Will,
The other thing that I found it weird is, I created a test Button on the same form using below code (onClicked event handler). By using Chrome I clicked on the test Button the txt file can be downloaded. After that I clicked on the button that got issue, the text file can be downloaded too.
But if let say I clicked before the test Button, the txt file cannot be downloaded. It seems something need to trigger it first. Btw, the code that I'm using is similar as below, just the content is different and it quite long so I share to you the sample one.
str filePath,
filePathAndName,
fileContent = "01234567890123456789";
;
// prepare file name
filePath = System.IO.Path::GetTempPath();
filePathAndName = filePath + 'f' + guid2str(newGuid()) + '.txt';
// Save file
File::SendStringAsFileToUser(fileContent, filePathAndName);