Change MaxFileSize Property Dynamically

2 posts, 0 answers
  1. Muhammad
    Muhammad avatar
    9 posts
    Member since:
    Mar 2013

    Posted 07 Jun 2014 Link to this post

         I have a simple scenario On my page load event I set MaxFileSize Property like this

    1.protected void Page_Load(object sender, EventArgs e)
    2.        {     
    3.DriveInfo d = new DriveInfo(HttpContext.Current.Request.PhysicalApplicationPath);  // get partition size
    4.       RadFileExplorer1.Upload.MaxFileSize = d.AvailableFreeSpace ;
    5.         }
    The Above code gets free Space of my C Drive and assign it to MaxFileSize property.

    Now in my application user can upload files in my C Drive, after a user upload a file and when press the Upload button, the above code gives me updated Free space but MaxFileSize property show old value

    Kindly Help,
  2. Vessy
    Vessy avatar
    1352 posts

    Posted 10 Jun 2014 Link to this post

    Hi Muhammad,

    Wen configuring the max upload size in FileExplorer you will need to use its Configuration's MaxUploadFileSize property. For example, you can have a similar implementation:
    protected void Page_Load(object sender, EventArgs e)
        DriveInfo d = new DriveInfo(HttpContext.Current.Request.PhysicalApplicationPath);
        RadFileExplorer1.Configuration.MaxUploadFileSize = (int)d.AvailableFreeSpace;

    You might also find useful information regarding uploading files bigger than 2MB in the following help article: Uploading Large Files

    Kind regards,

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

  3. DevCraft R3 2016 release webinar banner
Back to Top