using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Telerik.Web.UI.Widgets;
using System.IO;
using System.Collections;
using Telerik.Web.UI;
using System.Configuration;


public partial class FileExplorerPage : Page
{
	protected void Page_Load(object sender, EventArgs e)
	{
		RadFileExplorer1.Configuration.ContentProviderTypeName = typeof(CustomProvider).AssemblyQualifiedName;
	}
}

class CustomProvider : FileSystemContentProvider
{
	public CustomProvider(HttpContext context, string[] searchPatterns, string[] viewPaths, string[] uploadPaths, string[] deletePaths, string selectedUrl, string selectedItemTag)
		: base(context, searchPatterns, viewPaths, uploadPaths, deletePaths, selectedUrl, selectedItemTag)
	{
	}

	public override string StoreFile(UploadedFile file, string path, string name, params string[] arguments)
	{
		// Get the page that contains the RadFileExplorer
		Page _page = Context.CurrentHandler as Page;

		// Show alert message
		_page.ClientScript.RegisterStartupScript(_page.GetType(), "Key", "Sys.Application.add_load(refreshExplorer);", true);

		// else
		return base.StoreFile(file, path, name, arguments);
	}
}
