0

ENV: asp.net4.5 with ckfinder2.5.0(dll),and upload picture in ckeditor4.5.3_full. setps:

  1. config this as normal ckeditor and ckfinder configuration.

  2. Browser picture.

  3. click send to server, then an error message pops up with "upload files damaged"

  4. I do this in asp.net4.0 without this error.

Does anyone know what going on with this?

AJF
  • 11,767
  • 2
  • 37
  • 64
Marderary
  • 11
  • 1

1 Answers1

1

I got this problem resolved this morning, there i would like appreciate http://ckeditor.com/forums/Support/The-solution-of-CKFinders-the-uploaded-file-is-corrupt-for-ASP.Net-4.5

solution: 1. find App_Start/RouteConfig.cs in my .net 4.5 webapplication solution. 2. override ConvertToFriendlyUrl() method as below code:

public class MyWebFormsFriendlyUrlResolver : WebFormsFriendlyUrlResolver
{
    public override string ConvertToFriendlyUrl(string path)
    {
        if (!string.IsNullOrEmpty(path))
        {
            if (path.ToLower().Contains("/resource/ckfinder"))
            {
                return path;
            }
        }
        return base.ConvertToFriendlyUrl(path) ;
    }
}
public static class RouteConfig
{
    public static void RegisterRoutes(RouteCollection routes)
    {
        var settings = new FriendlyUrlSettings();
        settings.AutoRedirectMode = RedirectMode.Permanent;
        //routes.EnableFriendlyUrls(settings);
        routes.EnableFriendlyUrls(settings, new Microsoft.AspNet.FriendlyUrls.Resolvers.IFriendlyUrlResolver[] { new MyWebFormsFriendlyUrlResolver() }); 
    }
}

3. upload again, it works.

Marderary
  • 11
  • 1
  • Make sure to import Microsoft.AspNet.FriendlyUrls.Resolvers in order to pick up WebFormsFriendlyUrlResolver. – Jonty Jan 19 '18 at 16:24