fgl_getfile()
Retrieves a file from the front-end context to the virtual machine context.
Syntax
fgl_getfile(
remotePath STRING,
localPath STRING )
- remotePath is the path of the file to retrieve from the front-end context.
- localPath is the path of the file to write in the virtual machine context.
Usage
The fgl_getfile()
function uploads a file from the front-end workstation disk
to the application server disk where fglrun is executed.
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 write critical server files,
the program could transfer files from the client workstation and overwrite critical server files.
On the other hand, critical files can be read from the client workstation and copied on the
application server. It is in the hands of the programmer to implement file path and/or file
content restrictions in the programs using fgl_getfile()
.
When the front-end is located on a mobile device (GMA or GMI), the fgl_getfile()
function can take an opaque file path as first argument, to identify a local device resource
returned from a front call such as mobile.choosePhoto, mobile.takeVideo, standard.openFile. This allows you to retrieve the file content into the virtual machine context, for persistent
storage, and to share it with applications running on other devices. This
fgl_getfile()
feature can be used with a standalone app running on the device, or a
client/server app executing on a server and displaying on the device. For more details, see Runtime images, File management
on mobile devices.