Hi, I’m attempting to retrieve files from an online directory using:
Assign: arrFileNames = directory.GetFiles(strDirectory)
I have tried several different directories but constantly receive the following error:
Assign: The specified path, file name, or both are too long. The fully qualified file name must be less that 260 characters and the directory name muse be less that 248 characters.
I have checked the character count of both.
The fully qualified file name is 186 characters (less than 260)
The directory name is 157 characters (less than 248)
I have no idea why this Error message keeps displaying when neither of the counts exceeds the set limits. If anyone has encountered this issue before and has a solution, I would be grateful for any assistance.
I have tested it using a local directory and it works perfectly.
I’ve even tested it with longer local directory path+filenames and it works.
I’ve also tested with shorter online directories and still get the ‘Length’ error.
I’ve also pasted the online directory into a Windows file explorer and the directory has been located without issue, and the contests displayed correctly.
I’m wondering if the error is being displayed incorrectly but haven’t been able to find any information regarding the GetFiles module working with online directories.
I don’t see why studio would care if the address starts with "C:" or "http:" but it might
So the strDirectory is 145 characters long. None of the filenames in that directory are more than 100 characters long, so everything is within the parameters
If the issue is that the Directory.GetFiles can only be used for local files, does anyone know of another UiPath element that does work for online directories?
When I attempt to use a message box to display Directory.GetFiles(strDirectory).toString OR attempt to Assign arrFileNames = Directory.GetFiles(strDirectory) I get the same error message:
“The specified path, file name, or both are too long. The fully qualified file name must be less that 260 characters and the directory name muse be less that 248 characters.”
Just a quick update for anyone else who may have encounter a similar issue:
I was trying to obtain a list of file names that were attached to a Sharepoint list and saved at the URL listed in previous posts. As UiPath doesn’t see SharePoint directories the same as Network directories I had to download the “UiPathTeam.SharePoint.Activities” package which contained an activity called “Get List Item Attachments” which did exactly what I was trying to do and solved my issue