This question is locked. New answers and comments are not allowed.
Hello!
I tried to submit a bug to the issue tracker but seems that it is not allowed to submit issues for my account so I write here
Telerik MVC 2011 Q2
EditorFileBrowserController
property Filter default value is "*.png,*.gif,*.jpg,*.jpeg"
In inherited class Filter is overriden and has value "*" to allow uploading for all types of files.
But private method IsValidFile does not allow to use "*" - it requires enumatation if all allowed extensions explicitely defined.
But it is not obvious - I had to dig into source code and investigate why I cannot submit any file with "Forbidden" exception (from Upload method).
Following fix should allow using * symbol to specify all kinds of files
Thanks
I tried to submit a bug to the issue tracker but seems that it is not allowed to submit issues for my account so I write here
Telerik MVC 2011 Q2
EditorFileBrowserController
property Filter default value is "*.png,*.gif,*.jpg,*.jpeg"
In inherited class Filter is overriden and has value "*" to allow uploading for all types of files.
But private method IsValidFile does not allow to use "*" - it requires enumatation if all allowed extensions explicitely defined.
But it is not obvious - I had to dig into source code and investigate why I cannot submit any file with "Forbidden" exception (from Upload method).
if (!this.AuthorizeUpload(path, file)) throw new HttpException(403, "Forbidden");Following fix should allow using * symbol to specify all kinds of files
private bool IsValidFile(string fileName) { string extension = Path.GetExtension(fileName); return Filter=="*" || Enumerable.Any(Filter.Split(new[] { ',' }), e => e.EndsWith(extension, StringComparison.InvariantCultureIgnoreCase)); }Thanks