Changing cgi_files_save function to allow a file vs a directory to be specified. Also fixed a buffer overflow possibility.