Can't rename file

I am trying to rename a file, and I am getting the error “Rename File: Cannot create a file when that file already exist”… I am not trying to create a file I am trying to rename the file in the folder
I tried moving the file with a new name and that did not work either, my only success is creating a new file, then appending the CSV with the new data… but that won’t work with the PDF’s I need to move.

Also, once renamed I need to get the “new” file so I can utilize an upload file to sharepoint function

because the name you are renaming to already exists, can you add a delete file activity to delete
"IFC Commissions"&"_"&i_TodayDate

before your rename activity?

If I delete the file before it’s renamed there will be no file for it to rename…

If it was a duplicate wouldn’t it overwrite existing?

i mean delete the NEW name, not the original one…

i.e. if you are renmaing fileA to fileB ,
DELETE fileB first, NOT fileA
that way you can still rename fileA

image

But when it’s trying to rename, this file does not exist yet (file b)

Hey @Nathan_Betters1
In the new name tab try to give complete path ex: drive name +filenamenew.extension
Regards
Sreejith S S

I tried that, and the wait for download now is pulling I think a temp file?
Its odd because sometimes it works

Hello @Nathan_Betters1

Please provide the file extension as well in the Rename activity along with filename.

Thanks

It looks like the file has no extension please provide the extension for the file.

Regards

Sreejith S S

Hi @Nathan_Betters1 please try with move file activity:

image

Hello @Nathan_Betters1,
Kindly Try this method

  1. Use the if condition to know about the renamed file already exists or not.
    System.IO.File.Exists(in_CommissionFolderPath &“IFC Commissions”&“_”&i_TodaysDate+“.csv”)
  2. Place the Delete file activity(in_CommissionFolderPath &“IFC Commissions”&“_”&i_TodaysDate+“.csv”) in then and place Rename file in it.
  3. Else, place the Rename file and actually your activity is good, place it.