UploadFiles

Use to open the Upload Files dialog box that enables an application user to upload files from the local computer to the Web server.

Syntax

void UploadFiles (string serverFolder, long bgColor, int fileNum, boolean showServerFolder, string description, string allowExts{, string callbackFunctionName}{, PowerObject po})

Parameters

Returns

None.

Examples

Usage

Use the UploadFiles function in conjunction with a private callback function that you create for a PowerBuilder object.

The callback function should return an integer and take a string array for its only argument. The callback function script should include an iteration to fill up the string array with the names of files selected by the application user to upload to the server. For example, the following code can be added to a callback function "myuploadfiles_callback" with an upfiles[ ] string array argument:
    int i
    for i = 1 to upperbound(up_files)
       this.mle_1.text += "~r~n" + up_files[i]
    next
    return i

If the "myuploadfiles_callback" function is created on the window w_main, you can use this window name as the value of the po argument in your Upload Files call. If you create the "myuploadfiles_callback" function as a global function, you can use the UploadFiles callback syntax without the po argument.

If your application uses sequential UploadFiles calls in the same script, only the callback function in the last of the UploadFiles calls is valid. The other UploadFiles calls can still upload selected files to the Web server, but further processing of the names of the uploaded files does not occur, even when the syntax for these calls includes a callback function that codes for such processing.

If the last UploadFiles call in a script containing sequential UploadFiles calls does not use a callback function, no callback processing occurs.