GetFileItem Method (BUTTON)


PLBCMP GUI Only, 9.7A

 

The GetFileItem method retrieves the file names that have been selected by an end-user using a BUTTON File Upload selection dialog for a client browser. This method only returns file selection names when executing using the PL/B Web Server. This method uses the following format:

 

[label]

{object}.GetFileItem

[GIVING {return}] USING [*Index=]{index}[:

 

 

[*Flags=]{flags}]

 

Where:

label

Optional. A Program Execution Label.

object

Required. A Button that is accessed.

return

Optional. A Character String Variable that returns the file selection information.

index

Required. A Numeric Variable or decimal number that is a zero-based index into an array of file selection of files being retrieved.

flags

Required. A Numeric Variable or decimal number whose value provides bit mask values that are used to identify the type of data being retrieve for a given file selection.

Flags Affected: EOS, OVER, ZERO

Note the following:

  1. The EOS flag is set if the {return} Character String variable to too small to retrieve the file selection data.

  2. The ZERO and OVER flags are always cleared.

  3. If the {flags} bit mask value is zero, the {return} Character String variable is returned as a NULL variable. Otherwise, the {flags} bit mask values are described as follows:

  4.  

    Flag Values

    Returns the selected file ...

    0x1

    name.

    0x2

    type.

    0x4

    size.

     

  5. Any combination of these bit values can be used. If multiple bit mask values are specified in the {flags} value, the data fields (name, type, size) are separated by a '|' delimiter and returned in the {return} variable.

Example:

button.GetFileItem GIVING S$CMDLIN USING 0,5

 

S$CMDLIN could contain:

 

filename.ext|2048

 

 

See Also: Button Methods, Method Syntax



PL/B Language Reference GetFileCount (BUTTON) IOCancelMode Method (BUTTON)