The process of automatically uploading a downloaded file from a web page to the same web page again

s there a way to upload without specifying a file name? I automated the file download, but I want to know the process of re-uploading the downloaded file after that.
Even if I want to specify a file name to upload, it is difficult to build an algorithm because the downloaded file name is not the same every time. Please help me.

to sum up

  1. Bring up the number(String) of data from the testdata(excel) then download 2 files(not same file name)
  2. Reupload downloaded file (same page)

Can anyone tell me easily how to rename the downloaded file and put it in the designated folder from katalon? Video lectures related to this would be very beneficial.
I confirmed that It can be “rename” the file from the web browser…
But, When i record from katalon studio, " save as(rename) " can not be allowded…

I tried to make Custom Keyward like as

package renamefile

import static com.kms.katalon.core.checkpoint.CheckpointFactory.findCheckpoint
import static com.kms.katalon.core.testcase.TestCaseFactory.findTestCase
import static com.kms.katalon.core.testdata.TestDataFactory.findTestData
import static com.kms.katalon.core.testobject.ObjectRepository.findTestObject

import com.kms.katalon.core.annotation.Keyword
import com.kms.katalon.core.checkpoint.Checkpoint
import com.kms.katalon.core.checkpoint.CheckpointFactory
import com.kms.katalon.core.model.FailureHandling
import com.kms.katalon.core.testcase.TestCase
import com.kms.katalon.core.testcase.TestCaseFactory
import com.kms.katalon.core.testdata.TestData
import com.kms.katalon.core.testdata.TestDataFactory
import com.kms.katalon.core.testobject.ObjectRepository
import com.kms.katalon.core.testobject.TestObject
import com.kms.katalon.core.webservice.keyword.WSBuiltInKeywords
import com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords

import internal.GlobalVariable

import org.openqa.selenium.WebElement
import org.openqa.selenium.WebDriver
import org.openqa.selenium.By

import com.kms.katalon.core.webui.driver.DriverFactory

import com.kms.katalon.core.testobject.RequestObject
import com.kms.katalon.core.testobject.ResponseObject
import com.kms.katalon.core.testobject.ConditionType
import com.kms.katalon.core.testobject.TestObjectProperty

import com.kms.katalon.core.util.KeywordUtil

import com.kms.katalon.core.webui.exception.WebElementNotFoundException
import java.util.Arrays

public class filename {

public static void main(String[] args) throws IOException {

FileRename fr= new FileRename()
File newfile = fr.getTheNewestFile("C:\\Users\\hojun.lee\\Downloads", "csv")
newfile.renameTo(new File("C:\\Users\\hojun.lee\\Downloads\\dd.csv"))
String filename= newfile.getName()

System.out.println("latest file is="+filename)

FileRename fr1= new FileRename()
File updated = fr1.getTheNewestFile("C:\\Users\\hojun.lee\\Downloads", "csv")
System.out.println("Changed file name is ="+updated)


public File getTheNewestFile(String filePath, String ext) {
File theNewestFile = null
File dir = new File(filePath)
FileFilter fileFilter = new WildcardFileFilter("*." + ext)
File[] files = dir.listFiles(fileFilter)

if (files.length > 0) {
	/** The newest file comes first **/
	Arrays.sort(files, LastModifiedFileComparator.LASTMODIFIED_REVERSE)
	theNewestFile = files[0]


But it does not work… "C:\Users\hojun.lee\Downloads " is download path that new file is downloaded on. i want to change new file to “dd.csv”.
Can you help me ?