About the author

Miron Abramson
Me
Software Engineer,
CTO at PixeliT
and .NET addicted for long time.
Open source projects:
MbCompression - Compression library

Recent comments

Authors

Disclaimer

The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

© Copyright 2014

Creative Commons License

Blog Flux Directory
Technology Blogs - Blog Top Sites

Limit uploaded files size in FCKeditor

FCKeditor (Changed to CKEditor for some reasons) is the coolest editor for asp.net (it works also with lot of other languages). It is easy to implement, full of features and can be easily customized.

I use it for some personal sites. One important feature  that is missing is the option to control and limit the size of individual uploaded file. I know I can do it in the web.config using the httpRuntime section, but it will effect all the site. I wanted to control the limit of individual uploaded file. Since the ASP.NET FCKeditor is an open source, I downloaded the source and made some changes to conquer my needs. Below you can download the modified code, or the compiled dll (release mode).

To control the limits of the uploaded files, After you placed the modified dll in your BIN folder, dig into the folder  \editor\filemanager\connectors\aspx inside your editor folder. There you will find the file 'config.ascx'. The method 'SetConfig()' is the place you will made some changes:

Add TypeConfig["File"].MaxAllowdSize = 4096;  to set the maximum uploaded file to 4MB

Add TypeConfig["Image"].MaxAllowdSize = 2096; to set the maximum, uploaded image to 2MB

TypeConfig["Flash"].MaxAllowdSize = 2096; to set the maximum, uploaded flash to 2MB

TypeConfig["Media"].MaxAllowdSize = 4096; to set the maximum uploaded media file to 4MB

Of course the numbers can be change as your needs.

FredCK.FCKeditorV2.dll.zip (14.26 kb)

FCKEditor.NET_src.zip (61.11 kb)

Currently rated 5.0 by 5 people

  • Currently 5/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:
Categories: ASP.NET
Posted by Miron on Friday, September 25, 2009 5:34 AM
Permalink | Comments (3) | Post RSSRSS comment feed