Official Content

Returns the entire HTML body in a File.

Syntax

&VarBasedOnExtendedDataType.ToFile(FileName)

Where:

&VarBasedOnExtendedDataType
     Is a variable based on the HttpClient or HttpRequest Extended data type.

FileName
     Is the path to the file.

Scope

Extended Data Types: HttpClient, HttpRequest
Generators: .NET, JavaAngular

Samples

HttpClient:

&httpclient.execute("GET","/servlet/clients")
&httpclient.ToFile(“c:\htmls\clients.html”)

It returns the HTML code of the clients Web Panel object in the clients.html file.

HttpRequest:

&httprequest.ToFile(“c:\files\clients.json”)

When the object is a Main Procedure with the Call protocol property set to HTTP, it saves a file received by a web service call.

Security tips

Do not use the user's input concatenations or sanitize the user's entries to avoid path traversal or path manipulation vulnerability risks.

See Also

HttpClient Data Type
HttpRequest Data Type
Execute method

Last update: June 2025 | © GeneXus. All rights reserved. GeneXus Powered by Globant