get file by the scan_id index
filter metadata to separate dmsmail and mainfile attributes