Forum Discussion

Former_Member's avatar
Former_Member
Accelerator III
9 years ago

Renaming a file

Hi All, I am renaming the file name in Aras through db. Below is the query for the same. After renaming the file when i am trying to open the file file is not opening as the url is not correct and its missing the vault server link. DECLARE @oldFilename varchar(100)= '2030604_DWG_Rev_AMIT KUMAR .PDF' DECLARE @newFilename varchar(100)='AMIT KUMAR .pdf' update [Innovator94_Development_DEV].[innovator].[FILE] set [FILENAME]=@newFilename,[KEYED_NAME]=@newFilename where [KEYED_NAME] = @oldFilename

4 Replies

  • Hi Amit, As you know the files which you upload will be stored in the vault folder in server. Here you have changed the name of the file in the database but the physical file present in the vault folder was not changed because of the your link will not work.   Solution:  Locate the file which you renamed in the database from the vault then rename the name of that file to the same name as one which you gave on database. This should probably solve the issue.   Regards, Maher.
  • Thanks a lot! Since i am able to rename the file in Aras 11 i thought there might be a way to rename the same in other older versions as well. By the way i have to rename a lot more number of files so if i have to rename the files at both the location it will take a lot of time. Please suggest if there is any other feasible way. Thanks, Amit
  • Hi Amit, I am not sure whether this solution will help you out or not but you can try. You can create a aras method which renames the file associated with one whose name you are updating and you can trigger it on the update action of the item. Also alternatively you can create a samll script which accepts name of the file whihch you need to rename and also the new name in turn the script should rename it in database as well as in the vault. Regards, Maher.