fgl_putfile()
Transfers a file from the virtual machine context to the front-end context.
Syntax
FUNCTION fgl_putfile(
source STRING,
target STRING)
- source is the path of the file to be transferred from the virtual machine context to the front-end.
- target is the destination in the front-end context: With direct mode (GDC desktop), this is the path to the file to be written on workstation file system. With GAS + GBC in a web browser, this can be a simple name to be used as proposal for the download folder.
Usage
The fgl_putfile() function downloads a file from the application server disk
where fglrun is executed to the front-end workstation disk.
Using this function can result in a security hole if you allow the end user
to specify the file paths without control. There is no limitation on the file content or file paths.
If the user executing the application on the server side is allowed to read critical server files,
the program could transfer these files on the client workstation. On the other hand, critical files
can be written on the client workstation. It is in the hands of the programmer to implement file
path and/or file content restrictions in the programs using fgl_putfile().
CALL fgl_putfile("/var/myapp/files/myfile.txt",NULL)The "myfile.txt" basename of the source filename will be used to create the local file, in the browser download directory.