fgl_putfile()
Transfers a file from the virtual machine context to the front-end context.
Syntax
fgl_putfile(
localPath STRING,
remotePath STRING)
- localPath is the path to the file to transmit from the virtual machine context.
- remotePath is the path to the file to write on the front-end workstation file system. This parameter is ignored when the front-end is GAS + GBC in a web browser.
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", "dummy")
The "myfile.txt" basename of the source filename will be used to create the local file, in the browser download directory.