예제 #1
0
        public InvokeResult <ClearUploadedFilesRet> ClearUploadedFiles(ClearUploadedFilesParam param)
        {
            InvokeResult <ClearUploadedFilesRet> result = new InvokeResult <ClearUploadedFilesRet>()
            {
                Success = true, ret = new ClearUploadedFilesRet()
            };
            List <string> successFilePaths = new List <string>();

            try
            {
                foreach (var filePath in param.FilePaths)
                {
                    string uploadPathDecode = HttpContext.Current.Server.UrlDecode(filePath);
                    string uploadPath       = HttpContext.Current.Server.MapPath(uploadPathDecode);
                    FileAdapter.Delete(uploadPath);
                    successFilePaths.Add(uploadPathDecode);
                }
            }
            catch (Exception ex)
            {
                result.Success      = false;
                result.ErrorMessage = ex.Message;
            }
            result.ret.SuccessFilePaths = successFilePaths;
            return(result);
        }
예제 #2
0
 public void Delete(string filePath)
 {
     FileAdapter.Delete(_defaultPath + filePath);
 }