首页新闻找找看学习计划

web iis上传文件报与远程主机通信时发生错误。错误代码是 0x800703E5,

0
悬赏园豆:20 [待解决问题]

System.Web.HttpException (0x80004005): 与远程主机通信时发生错误。错误代码是 0x800703E5。 ---> System.Runtime.InteropServices.COMException (0x800703E5): 重叠 I/O 操作在进行中。

问题补充:

region 文件上传(单个)

    public ActionResult JqUpToFile()
    {
        try
        {
            //HttpPostedFileBase requestFile = null;
            //HttpFileCollection requestFile;
            //if (Request.Files["userExcelFile"] != null)
            //{
            //    requestFile = Request.Files["userExcelFile"];

            //}
            //获取orgId

            //上传地址配置到Config
            string ExcelPath = "/UpFile/UpToExcel/" + DateTime.Now.ToString("yyyy") + "/" + DateTime.Now.ToString("MMdd") + "/";
            string uploadPath = "";
            uploadPath = FileUpUrl + ExcelPath;
            if (!Directory.Exists(uploadPath))
            {
                Directory.CreateDirectory(uploadPath);
            }
            foreach (string key in Request.Files)  // 文件键
            {
                var uploadFile = Request.Files[key];
                string oFileName = uploadFile.FileName;
                string oExt = oFileName.Substring(oFileName.LastIndexOf('.'));
                oFileName = oFileName.Remove(oFileName.Length - oExt.Length, oExt.Length);
                //string filetype = oExt.Remove(0, 1);
                string fileName = oFileName + "_" + DateTime.Now.ToString("yyyyMMddHHmmssfff") + oExt;
                uploadFile.SaveAs(uploadPath + fileName);
                var data = new
                {
                    fileName = fileName,
                    filePath = ExcelPath + fileName,
                };
                return Ok(data);
            }
            return Ok();
            
        }
        catch (Exception e)
        {
            log.Info("上传文件异常:" + e.Message);
            throw;
        }
    } 
    #endregion
代码小六的主页 代码小六 | 初学一级 | 园豆:10
提问于:2018-12-06 17:09

上代码

dudu 1周前

@dudu: 本地测试没有问题,放到现有的win2012r2服务器上就出现上传失败,cpu 飙升20%多。

代码小六 1周前

@代码小六: 提供的代码中并没有“与远程主机通信”

dudu 1周前

FileUpUrl这个参数从哪里来的,值是啥

Rise-亟 1周前

@Rise-亟: web config 配置的路径 服务器一个具体物理路径

代码小六 1周前
< >
分享
所有回答(0)
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册