added method for getting file from filename