2nd with the help of writeline activity try to find out what is the output of lModFiles(0).ToString. it might help you figure it out where is the source of the problem.
It’s okay. I figured out the issue. UiPath ran too fast and before the file was downloaded and stored in the directory, UiPath already read what was inside the directory, causing the output to be null. Thanks for the help though.
Is there any way to pause the program or wait for the file to be added into the folder without using delay activity or file change trigger activity??