Image / File Browser problems

2 posts, 0 answers
  1. Abradax
    Abradax avatar
    14 posts
    Member since:
    Feb 2014

    Posted 09 Feb 2015 Link to this post

    I am implementing Kendo Editor with image and file browser capabilities.

    I have followed the example in demos, and have run into a problem.

    Image browser works fine when I use gif or jpeg files, but if I try to use a bmp file, I get a 403 error.

    For file browser, I am unable to get a simple xls file to upload without a 403 error.

    I know the code is working, as I can upload gif and xls files.  Is there another configuration change or other piece of code that is not included in the Demo that needs to be added for me to change the file types accepted by the browser?

    I tried the following:
                       .FileTypes(".bmp,.jpg,.jpeg,.gif,.png")

    While that does restrict what the user can attempt, it doesn't allow me to use the file types I need.
  2. Abradax
    Abradax avatar
    14 posts
    Member since:
    Feb 2014

    Posted 09 Feb 2015 in reply to Abradax Link to this post

    Nevermind, I figured it out about 4 seconds after posting this.

    If anyone else runs into this:

    Add this to the controller:

              public override string Filter
              {
                   get
                   {
                        return "*.png,*.gif,*.jpg,*.jpeg,*.bmp";
                   }
              }

    Also, the example refers to a FileBrowser controller, but the example wasn't posted.  I used the same code for the ImageBrowser but replaced the filter with:

              public override string Filter
              {
                   get
                   {
                        return "*.*";
                   }
              }

    And the appropriate strings to point to the correct location.

  3. UI for ASP.NET MVC is VS 2017 Ready
Back to Top