Add a File Field - Stored on DB

A File field, that is stored on DB, lets users add a file to a record in the Web Application. This is then stored in the database. The details below allows for storing a single file on a component. The next section explains how to create a relationship to the File Component so that multiple files can be stored in the database for a record.

To add MANY Files (Stored on DB) to a component and a form (Recommended Configuration)

Each file that is stored in the database can carry additional information about that file, called metadata. The File component allows you to capture metadata about the file you store to the database.

In order to be able to store multiple files in the database for a record, a relationship to the Files Component will need to be created.

  1. Open the Component in Component Management.
  2. Click on the Data Fields tab. A subform displays all the existing data fields.
  3. Click on Add New Relationships (found at the bottom of the subform)
  4. Select File as the Related Component.
  5. Enter the Relationship Name (from THIS component).
  6. Enter the Relationship Name (from RELATED component).
  7. Set the Number of records as follows:
    • 1 [THIS Component] record can have how many [RELATED component] records? Menu path separator Answer = Many
    • 1 [RELATED Component] record can have how many [THIS component] records? Menu path separator Answer = 1
  8. Save.
  9. Add the new data field to the form as a Subform. Save the form.
  10. Run a Publish.

To add a SINGLE File field (Stored on DB) to a component and a form

  1. Open the Component in Component Management.
  2. Click on the tab Relationships. A subform displays all the existing data fields.
  3. Click on Add New Relationships (found at the bottom of the subform)
  4. Select obj.com.bmssolutions.DBFile as the Related Component.
  5. Enter the Relationship Name (from THIS component).
  6. Enter the Relationship Name (from RELATED component).
  7. IMPORTANT: Set the Number of records as follows:
    • 1 [THIS Component] record can have how many [RELATED component] records? Menu path separator Answer = 1
    • 1 [RELATED Component] record can have how many [THIS component] records? Menu path separator Answer = 1
  8. Save.
  9. Add the new data field to the form as a Subform. Save the form.
  10. Run a Publish.

See Also

About File Fields

The File Component