SetFileOptions Method (BUTTON)


PLBCMP GUI Only, 9.7A

 

The SetFileOptions method sets the specific options used by the client browser File Upload selection dialog which can be invoked using a BUTTON object with the BUTTONTYPE=$FILEINPUT type. This method only takes affect when executing using the PL/B Web Server. This method uses the following format:

 

[label]

{object}.SetFileOptions

[GIVING {return}] USING [*Filter=]{filter}:

 

 

[*Flags=]{flags}

 

Where:

label

Optional. A Program Execution Label.

object

Required. A Button that is accessed.

return

Optional. A Numeric Variable whose value is always set to a zero.

filter

Optional. A Character String Variable or literal that contains a filter string that is applied by a client browser File Upload selection dialog to restrict the end-user file selections.

flags

Optional. A Numeric Variable or decimal number whose value provides bit mask values that are used control behaviors that are applied to the client browser File Upload selection dialog.

Flags Affected: EOS, OVER, ZERO

Note the following:

  1. The EOS and OVER flags are always cleared.

  2. The ZERO is always set.

  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

    Selects ...

    0x0

    only one file.

    0x1

    multiple files.

     

  5. The optional {filter} string can be specified to restrict the selection criteria to be applied by the client browser File Upload selection dialog. The {filter} string can be specified as a comma delimited list of MIME types as described for the 'accept' attribute of a HTML <input type="file"> tag. See the following browser link for more details on acceptable MIME types that can be used:

  6.  

    http://www.w3schools.com/tags/att_input_accept.asp

    Example of {filter} MIME Types:

     

    FileSel.SetFileOptions Using *Filter="" // Reset to not use any filtering

     

    FileSel.SetFileOptions Using *Filter="image/png" // Set the filter to png images only

     

    MOVE "image/gif,image/jpeg,image/png",S$CMDLIN

    FileSel.SetFileOptions Using *Filter=S$CMDLIN //Set the filter to images with gif, jpeg, and png types

     

    FileSel.SetFileOptions Using *Filter="image/*" // Set the filter to all image types

 

 

See Also: Button Methods, Method Syntax



PL/B Language Reference IOCancelMode Method (BUTTON)