-
-
Notifications
You must be signed in to change notification settings - Fork 773
CKEditor drag&drop files #5415
Copy link
Copy link
Closed
Labels
Description
Drag&Drop files on the CKEditor provide an "Internal Server Error"

Steps to reproduce
-Open an HTML Module
-Drag&drop a picture on it
- the image is well uploaded on the good folder but an issue stop the process to import it on the editor.
Error information
Additional context
How to fix this bug
Modify the file D:\dnn\dnnsources\Dnn.Platform-9.11.0\DNN Platform\Providers\HtmlEditorProviders\DNNConnect.CKE\Browser\Browser.aspx.cs
Find the procedure UploadFile, replace the script by a json response.
private void UploadFile(HttpPostedFile file, string command)
...
if (command == "EasyImageUpload")
{
var fileUrl = string.Format(!MapUrl(uploadPhysicalPath).EndsWith("/") ? "{0}/{1}" : "{0}{1}", MapUrl(uploadPhysicalPath), fileName);
this.Response.ClearContent();
this.Response.ContentType = "application/json";
this.Response.Write($"{{\"default\": \"{fileUrl}\"}}");
}
else
{
var fileUrl = string.Format(!MapUrl(uploadPhysicalPath).EndsWith("/") ? "{0}/{1}" : "{0}{1}", MapUrl(uploadPhysicalPath), fileName);
this.Response.ClearContent();
this.Response.ContentType = "application/json";
this.Response.Write($"{{\"uploaded\": 1, \"fileName\": \"{fileName}\", \"url\": \"{fileUrl}\"}}");
//this.Response.Write("<script type=\"text/javascript\">");
//this.Response.Write(this.GetJsUploadCode(fileName, MapUrl(uploadPhysicalPath)));
//this.Response.Write("</script>");
}
this.Response.End();
Affected version
All DNN versions since introduction of DNNConnect.CKEditorProvider.dll which replace the DNNConnect.CKEditorProvider_01.00.04.zip extension.
Reactions are currently unavailable
