File Transfer: Downloading a File

In a Genero application, downloading a file from the DVM (application server host) is handled by the fgl_putfile built-in function.

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

When preparing to deliver an application that includes a file download via the GWC, no modifications need to be made to the source files, form definition files, templates, or snippet sets. The application, and the file download, will work as-is given the default snippets.

When downloading a file, the file is transferred form the DVM to the application server first. The browser cannot put the file on the client without the user knowing about it. The user has to decide if he wants to retrieve the file and where to save it as a matter of security, otherwise files could be placed on the client machine when a user simply browses a Web site. Temporary files such as HTML pages, images and cookies that are part of Web standards are excluded from this restriction.

Download with FGL_PUTFILE

Figure 1 illustrates the process of downloading a file to the client from the DVM using the fgl_putfile function.


Downloading a file diagram
  1. The fgl_putfile function causes the requested file to move from its source location (where the DVM finds it) to the application server host.
  2. Retrieving this file - sent from the DVM to the application server - is done by using a File Transfer path (file/url). For details about File Transfer paths, see FileTransfer Object in Template Paths - Application hierarchy.
  3. The file data is downloaded to the client.

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