added checking for invalid/malicious filenames in network protocol