By looking at the posted code, Very likely the filename in the directory and download_manager table are mismatch.
let say this is download_manager table
let say these are the files in the directory
based on the code
$fileInfo["abc.txt"] --> Undefined index error
$fileInfo["xyz.doc"] --> Undefined index error