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

[Solved] How to configure/ restrict user from uploading an Image in Insert Image feature of MVC Telerik editor based on Image Size and Extension?

0 Answers 51 Views
Editor
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Ramakrishna
Top achievements
Rank 1
Ramakrishna asked on 02 Jan 2012, 11:04 AM

 

Below are the work around followed in achieving the end results. Please suggest for other best practices.

For Extension: Among the comma separated extension values, "*.png,*.gif,*.jpg,*.jpeg" provided in the file, telerik.imagebrowser.min.js, removed the extensions which are not required. Is there any other external configurable procedure to achieve the results?

For Size: Displaying a message to the user on Insert Image Dialog with a condition of maximum size that can be uploaded to the server and Implemented server side validation.
The return type after uploading image as available in sample demo applications is: "(ActionResult) this.Json((object) new FileEntry()". I have implemented the same way in Action method of my customized InsertImageController. So, if the image size is more than 2MB, I would like to alert the user with some valid information instead of 500 error after a long wait. Is there any way to configure this externally or do we need to modify the JSON and the handle methods at client side, in minified scripts of Telerik.

Please suggest the necessary appropriate steps required.

Thank You.

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