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

Image / File Browser problems

1 Answer 161 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Abradax
Top achievements
Rank 1
Abradax asked on 09 Feb 2015, 01:30 PM
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.

1 Answer, 1 is accepted

Sort by
0
Abradax
Top achievements
Rank 1
answered on 09 Feb 2015, 01:43 PM
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.

Tags
Editor
Asked by
Abradax
Top achievements
Rank 1
Answers by
Abradax
Top achievements
Rank 1
Share this question
or