show / hide menu

GetFileContent

The GetFileContent function is used to retrieve the content of a file from a file upload control in your application. This function is particularly useful when you need to access the content of a file that has been uploaded by the user.

Syntax

GetFileContent(FileUploadName, FileIndex)

  • FileUploadName: The name of the file upload control.
  • FileIndex: The index of the file within the file upload control.

Function Details

  • Function Name: GetFileContent
  • Argument Count: 2
  • Description: Retrieves the file content from a specified file upload control. Ensure that “Keep The File Stream on Upload/Download” is enabled for this functionality.

Arguments

  1. FileUploadName
    • Argument Type: Control
    • Is Optional: false
    • Description: The name of the file upload control from which the file content is to be retrieved.
  2. FileIndex
    • Argument Type: Integer
    • Is Optional: true
    • Description: The index of the file within the file upload control. This specifies which file’s content to retrieve if multiple files are uploaded. If not provided, the default is the first file (index 1).

Example

MessageBox(GetFileContent(FileUpload1, 1))

This example will display the content of the first file uploaded to the control named FileUpload1 in a message box.

Figure1: Rule

Figure2: Designer

Figure3: Preview

Usage:

By using the GetFileContent function, you can effectively manage and access the contents of files uploaded through your application’s file upload controls.