File Transfer: Uploading a File

In a Genero application, uploading a file from the front-end client is handled by the fgl_getfile built-in function.

The fgl_getfile function is documented in the Built-In Functions section of the Genero Business Development Language User Guide.

Uploading a file to the DVM

Figure 1 illustrates the process of uploading a file to the DVM.


Uploading a file to the DVM diagram

Figure 1. Uploading a file from the front-end to the DVM

  1. A form definition file defines the EDIT field with the STYLE="FileUpload" attribute. The underlying Genero data type needs to be large enough to contain the path of the file to upload, such as a STRING. The field displays with a Browse button that allows the user to locate the file. Once the file is located and selected by the user, it is transferred to the application server. The application server stores the file in the directory specified by the TEMPORARY_DIRECTORY element.
  2. The user executes the action that results in a call to the fgl_getfile built-in function, which requests the file from the application server.
  3. The file data is transferred from the application server and saved in the directory specified by the second fgl_getfile parameter.