Upload and move the save file to different location

I have some excel file in a folder and have to upload the file one by one and meanwhile or after i upload the file i need to move the same file to a different location, so it wont effect the process when it will run next time to upload.


UploadFiles.xaml (7.6 KB)

Check this xaml, you need to implement you upload method with this one and try.

using for each will not help.

My process is -
navigate to page
Upload the excel file(one excel file at a time, and file name is fixed)
move the excel file to processing folder with filename+datetime stamp
process the records
download the records
move the excel file from processing folder to processed with filename+datetime stamp

I need help with
how do i upload the folder with select the excel file ?
and file move with filename+datetime stamp


Do you need to upload the folder?

For move file you can use Move File Activity with from name and to file name with datetime stamp.


removed all the sepecial characters since it is the file name.

Yes i need to upload the folder and the folder path is same as my projectpath+""+Data+"".xlsx
while its processing the folder path will be projectpath+""+Data+""+Processing+""

how do i get this project path???

“CurDir” will give your Project path, but as a best practice it is not recommended to have process data related files inside the solution itself.

okay, thanks and how do i get the file name??

I took a variable uploadpath = Environment.CurrentDirectory+""+“Data”.ToString+""+"*.xlsx" giving me the below path
CurrentDirectory\Data*.xlsx then
i used this in type into activity to type the file path uploadpath+"[k(enter)]" but its not select the .xlsx file preset in the folder

I want to keep the file name dynamic so that even if the file name gets change at-least it will pickup the file


If your folder has more than one file then you need to get all those using Directory.GetFiles and loop that, if the folder has only one file, then use the same Directory.GetFiles and dont loop use the first one from that.

I have only one file in that folder

If that going to be with the same name then use that file name, else use Directory.GetFiles and use the top file from that String array of file information.

do u mind posting an example or any related post link?


This is the earlier file which I have shared, but modified few things as per the current changes. Check and let me know in case of any issues.

UploadFiles.xaml (8.7 KB)

thank you, this won’t help. as this .xaml is completely different then what i am looking.

anyway thank you, i got my direction