galaxy input file name changed

I am writing a tool to check whether the data files under a directory exists, given a list of files to be checked. However, it seems Galaxy change the input file names to be something like dataset_xxx.dat, saved in the galaxy/database/files/000. Is there anyway I can obtain the original input file name to perform the check process?

Besides, i am thinking whether Galaxy allows users to choose a directory/path as the input, passed into the python script as a variable to do some iterations for the check process?