Hi, I want to rename the profile name when I download/save in a folder.
I want to keep the save name of attachment just add the random number before it’s name.
Like my attachment name is Profile. I just want to add the variable which I already extracted data, want to add with the attachment name.
Expected output should be like this. 10000 Profile
@Palaniyappan @lakshman
@HareeshMR can you help to resolve this issue
Already checked this link this is something diff. My requirement is diff.
Use move file activity to rename or c# method ```
System.IO.File.Move(“oldfilename”, “newfilename”);
dear latter I want to use move activity, I have perform other operation after renaming it. So that’s way I want to rename it while downloading. I know I can do after downloaded. Hope you got it.
Hi @balkishan as i know while downloading the attachment you can’t rename move the file to the same path so that old file will not be there
@Jan_Brian_Despi can you help to resolve this issue.
Renaming a attachment name while download from the email .
Hi @balkishan,
Hello
What we can do here is we first download the attachment then rename it afterwards.
Thank you
*Let us assume that the attachment is only 1.
Once you use the Save Attachments activity, there is an Output called Attachments.
Get the output.
- Let’s say that the variable name is attachments. So we will use attachments(0).ToString to get the file path. Assign that to a variable (strFilePath).
- Get the directory and file name of the file path.
a. To get directory: Path.GetDirectory(strFilePath). Assign it to strDirectory
b. To get file name: Path.GetFileName(strFilePath). Assign it to strFileName - Once you already got the two, edit strFileName to your desired file name.
- Concatenate: strDirectory + "" + strFileName. Assign it to strNewFilePath
- Use Move File.
a. Path: strFilePath
b. Destination: strNewFilePath
Then you’re good to go.
Thanks and regards
If you observe bro point 5 option b. Destination: strNewFilePath is a file name after rename it not a Directory as you mentioned.
BTW It’s worked I modified it Thanks a lot.
Yeah. Good point. Haha.
EmailAttachment.xaml (8.3 KB)
Here you go. Just change Email, Password and File locations in two variables “FolderLocation” and “OutputLocation”
See that they are different folders, since this flow will throw an excpetion if they are in the same folder.
Hope this helps!
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.