Пример #1
0
        protected override IFtpFile DoCreateFile(string aFilename, VirtualFtpSession aSession)
        {
            if (HasFile(aFilename))
            {
                throw new FtpException(String.Format("Cannot create file \"{0}\", a file with this name already exists.", aFilename));
            }

            if (!AllowMkDir(aSession))
            {
                throw new FtpException(550, String.Format("Cannot create file \"{0}\", permission denied.", aFilename));
            }

            SecureFile lFile = new SecureFile(this, aFilename, fStorage);

            lFile.OwningUser = aSession.Username;

            Add(lFile);
            return(lFile);
        }
Пример #2
0
   throw new FtpException(String.Format("Cannot create folder named \"{0}\", a folder with this name already exists.",aFolderName));
 if (!AllowMkDir(aSession))
   throw new FtpException(550, String.Format("Cannot create folder named \"{0}\", permission denied.",aFolderName));