Genero Web Client Basics / File Transfer within the GWC |
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.
Figure 1 illustrates the process of downloading a file to the client from the DVM using the fgl_putfile function.
Figure 1. Downloading a file from the DVM to the front-end