Problem with system.fileinfo

Hi, there!
My automation doesn’t even initialize, because it says a variable is empty. The variable is of the type fileinfo, it gets the name of the file after it’s downloaded on the activity GetLastDownloadedFile. I tryed to set it as new System.IO.FileInfo(“”) as it’s shown on the image, but the error persists.

Please, help.

@micazev
welcome to the forum

the fileInfo has the purpose to reflect a particular file. So initalization only (empty with relationship to a file) will not avoid the issue.

ensure /check / debug in one round that the file was properly downloaded. Also check if the referenced download folder path is of valid / correct path and pointing to directory, where the file is downloaded

Hi Michelle,

Your variable doesn’t need to be initialized, but you might have an issue storing the output from GetLastDownloadedFile into the variable of type FileInfo.
Anyway, if you wish to have a initial value, you might try the expression: new System.IO.FileInfo("") . If the error persists during the runtime, please show the activity where you’re storing the data in the fileArquivo variable.

Note: You said the variable gets the name of the file, but having the type FileInfo, it contains all the information about the file, not only the name. If you’re storing the name, you should use a String variable.