In a SaaS environment, you don't have a file system on the server. You've only streams and you should use DownloadFromStreams. For example:
procedure CreateTxtFile(FileName: Text)
var
InStr: InStream;
OutStr: OutStream;
tmpBlob: Record TempBlob temporary;
CR: char;
LF: char;
begin
CR := 13;
LF := 10;
tmpBlob.Blob.CreateOutStream(OutStr);
OutStr.WriteText('First line'+ CR + LF);
OutStr.WriteText('Second line'+ CR + LF);
OutStr.WriteText('Third line'+ CR + LF);
tmpBlob.Blob.CreateInStream(InStr);
DownloadFromStream(InStr, '', '', '', FileName);
end;
If your extension targets only the on-premise world (target = internal) you've all the File methods available.