Multiple Upload functionality

How to upload multiple files?

I want to upload multiple files (Docx / PDF) , I have used UploadFile functionality . Following is the code -

import static com.kms.katalon.core.testobject.ObjectRepository.findTestObject
import com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords as WebUI

def list = []

def dir = new File(“C:\SampleFolder”)
dir.eachFileRecurse (FileType.FILES) { file ->
list << file

for (item in list) {
WebUI.uploadFile(findTestObject(‘SamplePage/btn_UploadFile’), item)

But this is not working. Getting Error as -

for (def item : list) FAILED.
groovy.lang.MissingMethodException: No signature of method: static com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords.uploadFile() is applicable for argument types: (com.kms.katalon.core.testobject.TestObject,

I am able to upload single file using-

WebUI.uploadFile(findTestObject(‘SamplePage/btn_UploadFile’), filePathofthefiletoupload)

WebUI.uploadFile() takes TestObject and String (path to a file), not File itself. You must get a path from File object and pass it to the keyword.