示例#1
0
        public override string DeleteFile(string path)
        {
            try
            {
                string virtualPathAndFile = FileSystemValidation.ToVirtualPath(path);

                string returnValue = DNNValidator.OnDeleteFile(virtualPathAndFile);
                if (!(string.IsNullOrEmpty(returnValue)))
                {
                    return(returnValue);
                }

                returnValue = TelerikContent.DeleteFile(virtualPathAndFile);

                if (string.IsNullOrEmpty(returnValue))
                {
                    string     virtualPath = FileSystemValidation.RemoveFileName(virtualPathAndFile);
                    FolderInfo dnnFolder   = DNNValidator.GetUserFolder(virtualPath);
                    DNNFileCtrl.DeleteFile(PortalSettings.PortalId, Path.GetFileName(virtualPathAndFile), dnnFolder.FolderID, true);
                }

                return(returnValue);
            }
            catch (Exception ex)
            {
                return(DNNValidator.LogUnknownError(ex, path));
            }
        }