This is a migrated thread and some comments may be shown as answers.

ImageBrowser and FileBrowser Not Working

5 Answers 327 Views
Editor
This is a migrated thread and some comments may be shown as answers.
David
Top achievements
Rank 1
David asked on 06 Dec 2017, 06:58 AM

.NET Core 2.0 MVC Application; Telerik UI for AspNet Core & Kendo UI 2017.3.1116

I am following the example posted at http://demos.telerik.com/aspnet-core/editor/imagebrowser

The control is able to read, create a folder, and delete but I cannot upload an image or file.  The error returned in the alert is, "Error! The requested URL returned 500 - ".  This is in debug mode in Visual Studio 2017.  I checked IIS Express log files and system events which give no additional information.

The system response title is, "<h1>An unhandled exception occurred while processing the request.</h1>
            <div class="titleerror">MissingMethodException: Method not found: &#x27;Microsoft.Net.Http.Headers.ContentDispositionHeaderValue Microsoft.Net.Http.Headers.ContentDispositionHeaderValue.Parse(System.String)&#x27;.</div>
                <p class="location">Kendo.Mvc.UI.FileBrowserController.GetFileName(IFormFile file)</p>"

This leads me to believe this is an issue in Core 2.0 compatibility with the way the IFormFile interface is implemented internally in the Kendo.Mvc.UI.EditorImageBrowserController class.

 

 

 

5 Answers, 1 is accepted

Sort by
0
Dimitar
Telerik team
answered on 11 Dec 2017, 08:16 AM
Hello David,

Thank you for the detailed explanation provided.

I have investigated the problem and I can confirm that there is an issue with the current FileBrowser/ImageBrowser implementation in ASP.NET Core 2.0. I have logged this in the official Kendo UI GitHub repository (#3839), from where you can keep track of the progress that we make on this issue.

As a small token of gratitude for reporting this bug, I have updated your Telerik points accordingly.

Regards,
Dimitar
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Renato
Top achievements
Rank 1
answered on 16 Jan 2018, 12:48 AM

Hi Dimitar, 

I'm just trying to upload images with the imagebrowser from editor and I'm getting a 500 internal error.

Is this error related with the bug you are fixing?

I'm sending a screenshot with the error message.

Thank you in advance for te reply 

Best regards

 

0
Dimitar
Telerik team
answered on 16 Jan 2018, 12:34 PM
Hello Renato,

Yes, the observed error is caused by that I have referred with my previous post. The issue is reproducible only with ASP.NET Core 2.0 and is related to the Http.Headers changes in this version. I would suggest to subscribe to the GitHub issue, so that you can receive notifications when the item is updated.

Regards,
Dimitar
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Grady
Top achievements
Rank 1
answered on 10 Feb 2018, 01:36 PM
the same issue with me.
0
Dimitar
Telerik team
answered on 12 Feb 2018, 09:17 AM
Hello Grady,

For a temporary workaround until the issue is resolved with an official fix, the GetFileName method can be overrided in the ImageBrwoserController as follows:
public class ImageBrowserController : EditorImageBrowserController
{
  // ...       
 
  public override string GetFileName(IFormFile file)
  {
    var fileContent = ContentDispositionHeaderValue.Parse(file.ContentDisposition);
 
    return Path.GetFileName(fileContent.FileName.ToString().Trim('"'));
  }
}

I am also attaching a sample ASP.NET Core solution, where the above is demonstrated in action.

Regards,
Dimitar
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
Editor
Asked by
David
Top achievements
Rank 1
Answers by
Dimitar
Telerik team
Renato
Top achievements
Rank 1
Grady
Top achievements
Rank 1
Share this question
or