I’m using invoke method to rename file , It works If I use default content file in old path for new name in new path but I can’t rename dynamic Content File . Invoke Method File display that : “File Not Found” . How can I fix it ?
Ex : Old File : “portal.auone.jp_13118.png” , 13118 is dynamic number . Some time It will be changed another number when my url called
Assign arr_files = Directory.GetFiles("Your Folder Path","portal.auone.jp_*.png").OrderBy(Function(d) New FileInfo(d).CreationTime).ToArray //This will provide all the files in that folder sorted based on creation time.
Str_filename = arr_files(0) //This will get the first file which is most recent one
you can use this variable to get the file name and rename it as per your existing logic.
Ex : This is my dynamic url :
sp-web.search.auone.jp/search?client=mobile-kddi&channel=android&sr=0000&q=*
sp-web.search.auone.jp/search?client=mobile-kddi&channel=android&sr=0000&q=&tr=
It’s different between “tr” and “not tr” . Some time url was generated include tr , some time it was not . So, How can I rename a file by contains string in url ( not full string url ) ?
Firstly , Thanks for taking time . I have file with dynamic name which generated from my url .
But My dynamic file some time include “tr” at last , some time it’s not
example : abc_edf/q=‘1234’/tr=‘123’.png
abc_edf/q=‘1234’.png
I can rename file dynamic with ‘abc_edf/q=*’ as you said . But when file add more ‘/tr=…’ . I can’t rename . so , How can I do it ?
As far as I understood the last tr should not be a problem right because we are searching for the starting text which is more common and with the help of that we are going to get the full file name and you would be replacing that entire name with the new name.
Maybe if you can share if your original scenarios like
old name 2. New Name you would like to rename with a few examples that would provide some insights and maybe I can help based on that.