GetFiles - Length error for Assign Activity

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.

Can you test it against a directory on your local computer? It is possible that the length of full directory name & file name exceeds 260 characters.

Hi, thanks for your reply.

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

Hello @danny.vardanega

Can you share the screenshot of the online directory which you are using?

Also what are the values in the variable “strDirectory” ?

As per my understanding this can be helpful for local directories and not online directories.

Can you use Message Box to show the path of a file name? It is likely that the network drive path is super long.