URI formats not supported

hello experts,

I am trying to get files from a specific folder. it works well when I’m using local folder IO.directory.getfiles

however, when I change to my server folder which starts with http://xxxx, it prompt me the above error.

help needed.

@flyingdragon

Could you please check folder path properly once. I guess it local folder won’t start with ‘http’.

hi @lakshman

is not a local folder. is a intranet folder. when I open the intranet folder, the path of the folder starts with https

@flyingdragon

Is it possible to open that folder without ‘https’ ?

@lakshman let me check and I get back to u

Hi @flyingdragon

Welcome to uipath community

try to get like this with a assign activity
out_path= new Uri(uriPath).LocalPath

where out_path is a string variable
and uriPath is your uripath of your server, the file path
Kindly try this and let know
Cheers @flyingdragon

2 Likes

did that work buddy @flyingdragon

hi @Palaniyappan

I got an error. I’m using assign to get the folder path in excel.

after that, I using another assign activity with string to get the files. but there’s an error.

my files are saved in network drives.

Fine
First assign the uri path to a string variable
Then use that variable as a path while defining directory.GetFiles method

Then when you are trying to get the path from arrfiles, if you know the exact no of the index you can get from it and assign to a variablename like this
Out_filepath = arrfiles(0).ToString
Where 0 is the index …
Or
Pass the arrfiles to a for each loop and iterate through each value in the array by changing the type argument in for each loop as string and the value like this
Out_filepath = item.ToString

Cheers @flyingdragon

Did that work buddy @flyingdragon

@Palaniyappan. Hi Buddy! I used your recommendation of assign activity out_path=new URI(uriPath).LocalPath to copy or move excel file from local drive to shared drive/intranet folder. I got error message “Could not find a part of the path”. This was what I did with assign activity:

destination = new URI (“http://intranet, shared drive path…/test”).LocalPath

Notes:

  1. destination = string variable
  2. I have access rights to this shared drive folder, ie, was able to manually copy excel file into it
  3. specifying the excel filename and extension after /test folder still yield same error message
  4. had placed a message box after assign activity (destination=…). Message box output; http:// and 1st part of path did not show up. Remaining path was captured.

THANKS in advance for your help. Kindly help please!

1 Like

Hi
Welcome to uipath community
Fine
Were we able to sync that shared drive to our local drive
That is we could be able to add that intranet drive to our drive network
So that we can directly use Directory.GetFiles method once after syncing

Cheers @CKD