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

Access RadFileExplorer Files with C#

3 Answers 194 Views
FileExplorer
This is a migrated thread and some comments may be shown as answers.
Robert
Top achievements
Rank 1
Robert asked on 14 Dec 2011, 09:48 PM
I'm writing to ask how best to read folders and/or files from a populated RadFileExplorer control, programmatically with C#;

Each day, date sensitive .pdf and .xls files are uploaded, via the RadFileExplorer;  On subsequent days, the previous days .pdf and .xls are manually moved to an Archive folder - also contained in the RadFileExplorer;  

The objective is to eliminate the manual process of moving files, and programmatically accomplish the same task;     

Any insight is appreciated;  Best regards - Rob

<telerik:RadFileExplorer ID="RadFileExplorer1" Runat="server" Width="100%" OnClientItemSelected="OnClientItemSelected"
                    ExplorerMode="FileTree" 
                    OnClientLoad="OnFileExplorerLoad" 
                        VisibleControls="TreeView, Grid, Toolbar, ContextMenus" 
                    TreePaneWidth="100%" BorderColor="Transparent" BorderStyle="None" 
                    EnableCopy="True" Height="600px" >
                    <Configuration ViewPaths="~/Customers" UploadPaths="~/Customers/"
                        DeletePaths="~/Customers/" MaxUploadFileSize="2147483647" />
                </telerik:RadFileExplorer>

3 Answers, 1 is accepted

Sort by
0
Accepted
Dobromir
Telerik team
answered on 16 Dec 2011, 12:26 PM
Hi Robert ,

You can use RadFileExplorer's ExplorerPopulated server-side event to access and manipulate the files and folders loaded in the control. Please find more detailed information regarding RadFileExplorer's server-side events in the following help article:
Server-side events

However, I believe the best approach for solving this case will be to create a ScheduledTask on the server to copy the files in the archive folder.
http://technet.microsoft.com/en-us/library/cc758861%28WS.10%29.aspx

All the best,
Dobromir
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
0
Sukhbinder
Top achievements
Rank 1
answered on 11 May 2012, 11:13 AM
Hi Telerik Team,

I have been facing an issue with the RadFileExplorer - need to access the files being uploaded so that can do such things like renaming etc before its being saved into the specified folder.

Thanks in advance.

Regards
SS Bhogal
0
Dobromir
Telerik team
answered on 14 May 2012, 02:17 PM
Hi Sukhbinder,

In order to access the uploaded file to rename it, you need to subclass RadFileExplorer's FileSystemContentProvider class and override its StoreFile() method. More detailed information on how to subclass the content provider is available in the following help article:
Using custom FileBrowserContentProvider

Also, you can find an example for renaming the uploaded files in the following KB article:
Giving the uploaded files unique names

Regards,
Dobromir
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
FileExplorer
Asked by
Robert
Top achievements
Rank 1
Answers by
Dobromir
Telerik team
Sukhbinder
Top achievements
Rank 1
Share this question
or