i created a new project with single file with download code, compiled and executed, it works fine
$file_contents = “dsadsadsa dsad asd sad asdsad sad”;
$filename = exo_return_hescriptcom("UserMain.ExportMyFile", "Error");
$fp = fopen($filename,'wb');
fwrite($fp, $file_contents);
fclose($fp)...