Use getSafeFileName in saveFilesToAgentDirectory