Finding PDF file in the server


#1

Hi Everyone,

I have a scenario that, need to find the PDF file which is stored the server. Also in server many folder are their it’s like 100 folders. Then i have to attach that file into outlook mail and send. I’m new to RPA…please hele me out…


#2

Hi @Mohan1,

Refer this code

var filenames = Directory.EnumerateFiles(Filelocation, “*.pdf”, SearchOption.AllDirectories);
foreach (string fileName in filenames)
{
filePathList.Add(fileName);
}
Regards,
Arivu


#3

Thank you arivu…let me try this…


#4

Hi aruvi,

Filename should be what type? String or array of string


#5

Hi @Mohan1,

create variable ->filenames -string[]
create variable ->Filelocation-string(File Path)
create variable ->filePathList->List(if you required)
Assign ->filenames=Directory.EnumerateFiles(Filelocation, “*.pdf”, SearchOption.AllDirectories)
use for each activity to get the all pdf file path.

Regards,
Arivu