Asp.net mvc 4 MVC4编辑器文件上载无法返回url
我已经在mvc4应用程序中实现了CKeditor文件浏览和上传。文件浏览工作正常,但当我点击文件浏览时,它不会在预览框中显示图像 下面的JS代码用于设置文本框上的URLAsp.net mvc 4 MVC4编辑器文件上载无法返回url,asp.net-mvc-4,ckeditor4.x,Asp.net Mvc 4,Ckeditor4.x,我已经在mvc4应用程序中实现了CKeditor文件浏览和上传。文件浏览工作正常,但当我点击文件浏览时,它不会在预览框中显示图像 下面的JS代码用于设置文本框上的URL function updateValue(id, value) { // this gets called from the popup window and updates the field with a new value $('#' + id).val(value);
function updateValue(id, value) {
// this gets called from the popup window and updates the field with a new value
$('#' + id).val(value);
}
另一件事是,当我选择文件并将其发送到服务器时,路径就消失了
这是我的控制器代码
public void uploadnow(HttpPostedFileWrapper upload)
{
if (upload != null)
{
string ImageName = upload.FileName;
string path = System.IO.Path.Combine(Server.MapPath("~/content/images/uploads"), ImageName);
upload.SaveAs(path);
}
}
让我知道如何解决这两个问题。使用nuget包中的ckeditor mvc4
CKEDITOR.replace('editor1', {
filebrowserImageBrowseUrl: '/home/uploadPartial',
filebrowserImageUploadUrl: '/home/uploadnow',
});
看看这个例子,谢谢,但我解决了它。我已经在那个链接上做了同样的步骤。