ToFile Method

Official Content
This documentation is valid for:
Returns all the HTML body in a File.

Syntax

&DataType.ToFile(FileName)

Where:
FileName
It is the path to the file

Example

HttpClient:

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

It returns the HTML code of the webpanel clients in the clients.html file.

HttpRequest:

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

In a main procedure with call protocol HTTP, it saves a file received by a webservice call.

Security tips

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

Scope

Extended Data Types: HttpClient, HttpRequest
Languages: .NET, Java, Ruby (up to GeneXus X Evolution 3), Visual FoxPro (up to GeneXus X Evolution 3)

See Also

HttpClient Data Type
HttpRequest Data Type