Search.../

reset( )

Clears the files that are pending upload.

Description

The value of the upload button contains a list of files that have been selected to upload. The reset() function clears the files in value.

Syntax

function reset(): void

reset Parameters

This function does not take any parameters.

Returns

This function does not return anything.

Return Type:

void

Was this helpful?

Clears the files pending upload

Copy Code
1let files = $w("#myUploadButton").value;
2let fileName = files[0].name; // "myPic.jpg"
3let fileSize = files[0].size; // 45941
4
5if(fileSize > '40000') {
6 $w("#myUploadButton").reset();
7 files = $w("#myUploadButton").value;
8 $w("#text1").text = "Please choose a smaller file to upload.";
9}