Ckeditor CKFinder-快速上载成功上载后不将URL传递到图像信息选项卡

Ckeditor CKFinder-快速上载成功上载后不将URL传递到图像信息选项卡,ckeditor,ckfinder,Ckeditor,Ckfinder,当我使用“快速上载”选项卡上载文件时,成功上载后URL不会传递到“图像信息”选项卡。如果在成功上载后从“快速上载”中选择“确定”,CKFinder将切换到“图像信息”选项卡,并显示以下错误消息“图像源URL丢失”。有人能解释为什么会发生这种情况吗?请使用此代码 在编辑器配置中- config.filebrowserUploadUrl = "/VirtualDirectoryName/ControllerName/ActionName"; 你的行动方法 public class Controll

当我使用“快速上载”选项卡上载文件时,成功上载后URL不会传递到“图像信息”选项卡。如果在成功上载后从“快速上载”中选择“确定”,CKFinder将切换到“图像信息”选项卡,并显示以下错误消息“图像源URL丢失”。有人能解释为什么会发生这种情况吗?

请使用此代码

在编辑器配置中-

config.filebrowserUploadUrl = "/VirtualDirectoryName/ControllerName/ActionName";
你的行动方法

public class ControllerName: Controller
    {
        public ActionResult ActionName(HttpPostedFileBase upload, string CKEditorFuncNum, string CKEditor, string langCode)
        {
            if (upload != null)
            {
                string fileName = Guid.NewGuid() + Path.GetExtension(upload.FileName);

                string basePath = Server.MapPath("~/Uploads");
                upload.SaveAs(basePath + "\\" + fileName);

                string url = Request.Url.GetLeftPart(UriPartial.Authority) + Request.ApplicationPath + "/Uploads/" + fileName;

                HttpContext.Response.Write("<script>window.parent.CKEDITOR.tools.callFunction(" + CKEditorFuncNum + ", \"" + url + "\");</script>");
                HttpContext.Response.End();
            }

            return View();
        }
    }
公共类控制器名称:控制器
{
public ActionResult ActionName(HttpPostedFileBase上载、字符串CKEditorFuncNum、字符串CKEditor、字符串langCode)
{
如果(上传!=null)
{
字符串文件名=Guid.NewGuid()+Path.GetExtension(upload.fileName);
字符串basePath=Server.MapPath(“~/Uploads”);
upload.SaveAs(basePath+“\\”+文件名);
字符串url=Request.url.GetLeftPart(UriPartial.Authority)+Request.ApplicationPath+“/Uploads/”+文件名;
HttpContext.Response.Write(“window.parent.CKEDITOR.tools.callFunction(“+CKEditorFuncNum+”,\”+url+“\”);
HttpContext.Response.End();
}
返回视图();
}
}

我可以使用CKEditor 4。您可以这样尝试:

public ActionResult uploadnow(HttpPostedFileWrapper upload, string CKEditorFuncNum)
    {
        string path = "";
        string pathWeb ="";
        if (upload != null)
        {
            string ImageName = upload.FileName;
            string extention = Path.GetExtension(ImageName);
            string name = DateTime.Now.ToString("yyMMddhhmmssms");
            ImageName = name + extention;
            pathWeb = "/images/uploads/" + ImageName;
            path = System.IO.Path.Combine(Server.MapPath("~/images/uploads"), ImageName);
            upload.SaveAs(path);
            HttpContext.Response.Write("<script>window.parent.CKEDITOR.tools.callFunction(" + CKEditorFuncNum + ", \"" + pathWeb + "\");</script>");
            HttpContext.Response.End();
        }
        return View();
    }
public ActionResult uploadnow(HttpPostedFileWrapper upload,字符串CKEditorFuncNum)
{
字符串路径=”;
字符串pathWeb=“”;
如果(上传!=null)
{
字符串ImageName=upload.FileName;
字符串扩展名=Path.GetExtension(ImageName);
字符串名称=DateTime.Now.ToString(“YYMMDDHHMMSMS”);
ImageName=名称+扩展名;
pathWeb=“/images/uploads/”+图像名称;
path=System.IO.path.Combine(Server.MapPath(“~/images/uploads”),ImageName);
upload.SaveAs(路径);
HttpContext.Response.Write(“window.parent.CKEDITOR.tools.callFunction”(“+CKEditorFuncNum+”,\”+pathWeb+“\”;”);
HttpContext.Response.End();
}
返回视图();
}

您使用的是CKFinder还是您自己的上传程序?我使用的是CKFinder的上传程序。如果您需要询问他们的支持团队,那么这里似乎不是您提出问题的正确位置。