How to use original file name in OnDownload?

After click download button, normally the file downloaded by browser will have its own name. But I need to save the file to specific folder. How can I save it with this original name?

This is useless:
{
“Command”: “onDownload”,
“Target”: “FolderA/FolderB/”,
“Value”: “”,
“Description”: “”
}

How should the code be like? Thanks~

If you do not use the OnDownload command, then the original file name is preserved.

If you need to copy the file from the download folder to another folder, you can trigger a basic batch file (or Python) script with the XRUN command after the download is complete.

Or you use the hard-drive mode, then the download folder is the UI Vision root folder + “/download”.

Thanks. So there’s no other method to get the original name then. Unfortunately, the XRun need XModule, which is blocked by our IT policy. Thanks anyway.

Actually, you can get the original file name. It is in the ${!Last_Downloaded_File_Name} variable: (read only) Get the name of the downloaded file. This requires ONDOWNLOAD to be inside the macro.

You could store this value e. g. in a CSV file, and then use this info you to rename the downloaded file afterwards.