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

Change MaxFileSize Property Dynamically

1 Answer 57 Views
FileExplorer
This is a migrated thread and some comments may be shown as answers.
Muhammad
Top achievements
Rank 1
Muhammad asked on 07 Jun 2014, 08:04 PM
Hi,
     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,
Thanks

1 Answer, 1 is accepted

Sort by
0
Vessy
Telerik team
answered on 10 Jun 2014, 11:14 AM
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,
Vessy
Telerik
 

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.

 
Tags
FileExplorer
Asked by
Muhammad
Top achievements
Rank 1
Answers by
Vessy
Telerik team
Share this question
or