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

FileDialog to select a folder

19 Answers 1179 Views
FileExplorer
This is a migrated thread and some comments may be shown as answers.
Jason Bourdette
Top achievements
Rank 1
Jason Bourdette asked on 18 Jun 2010, 04:21 PM
When using the FileExplorer control with a RadWindow as sort of FileDialog, is it possible to just select a folder path. I dont want to select a specific file, just a folder.


Thanks
Jason

19 Answers, 1 is accepted

Sort by
0
Dobromir
Telerik team
answered on 21 Jun 2010, 01:05 PM
Hi Jason,

In order to provide the Folder select functionality (like the one demonstrated in FileSelector Demo) I suggest you to use an external button and not to use OnClientFileOpen event.

For your convenience I have attached a sample project with the required functionality implemented.

Sincerely yours,
Dobromir
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Jason Bourdette
Top achievements
Rank 1
answered on 28 Jun 2010, 04:39 PM
thanks. that works good except:

on my aspx page i have the function

function OpenFileSelected(wnd, fileselected){
var textbox = $get("<%= RadTextBox1.ClientID %>");
textbox.value = fileselected;
}

So after the above function runs the value of the textbox does equal the folder path i selected, but the text doesnt display in the textbox. I click inside the textbox then the text apears.

any ideas?

thanks
0
Accepted
Fiko
Telerik team
answered on 29 Jun 2010, 07:28 AM
Hello Jason,

When you use a RadTextBox, you need to use its textbox.set_value(fileselected)  method in order to change the text. Also, you have to use the $find() method instead of $get() one. $find is used in order to get reference to an AJAX enabled control.

I hope this helps.

Regards,
Fiko
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Jason Bourdette
Top achievements
Rank 1
answered on 29 Jun 2010, 03:01 PM
Another question about the RadWindow as a FileDialog.

On my main page I have a RadcomboxBox and I want to pass the value of that comboBox to the FileDialog Rad Window. How to do this?

In my main page I tried to change the:

function OpenFileExplorerDialog()
{
   var wnd = $find ( "<%= FileExplorer.ClientID %>");
   var combobox = $find ( "<%= RadComboBox1.ClientID %>");
   var path = "explorer.aspx?id=" + comboxbox.get_text();
   wnd._navigateURL = path;
   wnd.show();
}

when debugging I do get the correct value in path and _navigateURL, however the page_load event for explorer.aspx seems to only execute the first time the user opens the radwindow. If the user closes the radwindow, makes a change to the combobox and reopens the radwindow the radwindows doesnt get the correct value from the combobox.

Thanks!!!!
0
Accepted
Fiko
Telerik team
answered on 02 Jul 2010, 09:14 AM
Hi Jason,

In your case I recommend you to remove this line of the code:
wnd._navigateURL = path;

and replace it with this public method:
wnd.setUrl(path);


The behavior that you experience is the expected one, because by default RadWindow's ReloadOnShow property is set to false. In your case you need to set this property to true and in order to cause the RadWindow control to load its content page every time it is shown.

I hope this helps.

Greetings,
Fiko
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Miguel
Top achievements
Rank 1
answered on 17 Jan 2011, 04:24 PM
Hi Fiko, is there a way to do this functionality in the server side?
I want to select a folder and get the path in order to place it in a text box and then call a button that uses that path.

Could you please help me out?

Thanks!
Miguel
0
Dobromir
Telerik team
answered on 19 Jan 2011, 05:15 PM
Hi Miguel,

FileSelection functionality is entirely client-side and RadFileExplorer does not preserve information for the selected item upon postbacks. In order to pass the path of the selected folder on the server, I suggest you to store the value to a hidden filed.

Regards,
Dobromir
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
0
July
Top achievements
Rank 2
answered on 30 Nov 2011, 07:15 PM
It is posible limited only to show Folder?
No show Files?---

I need selected a Folder only!
0
Dobromir
Telerik team
answered on 05 Dec 2011, 01:34 PM
Hi Julieta,

You can display only folders in the RadFileExplorer by overriding the ResolveDirecotory() method of the content provider and return DirectoryItem with empty array as files, e.g.:
public override DirectoryItem ResolveDirectory(string path)
{
   DirectoryItem originalFolder = base.ResolveDirectory(path);
   List<FileItem> noFilesFiles = new List<FileItem>();
 
   DirectoryItem newFolder = new DirectoryItem(originalFolder.Name, originalFolder.Location, originalFolder.FullPath, originalFolder.Tag, originalFolder.Permissions, noFilesFiles.ToArray(), originalFolder.Directories);
 
   return newFolder;
}


Best wishes,
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
July
Top achievements
Rank 2
answered on 05 Dec 2011, 03:55 PM
Where i write this?
According to example ,In Explorer.aspx ?
0
Dobromir
Telerik team
answered on 07 Dec 2011, 04:51 PM
Hi Julieta,

Please accept my apologies for not being clear enough in my previous reply.

The provided code snippet is an override of a method of the RadFileExplorer's content provider. Please take a look at the following help article for more detailed information on how the content provider works:
Using custom FileBrowserContentProvider

In order to display only the folders you need to implement custom content provider to the RadFileExplorer which subclasses the default FileSystemContentProvider and just override ResolveDirecotory() method using the code from my previous reply.

An examples demonstrating how to implement custom content provider to RadFileExplorer and subclass FileSystemContentProvider are available in the following live demos:
FileExplorer / Custom File Content Provider
FileExplorer / Filter files and download

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
Ravi
Top achievements
Rank 1
answered on 29 Apr 2014, 10:07 AM
Hi Dobromir,

  I have  seen your  zip code      everything is good  but i want change one thing   i want to browse client Machine folder   not  application folder  
 can i Browse the client Machine  folder   instead of  Root  Folder  of application  if yes  then how ?


0
Dobromir
Telerik team
answered on 29 Apr 2014, 11:30 AM
Hello Ravi,

It is not possible to access user's local hard drive using JavaScript. This is not a restriction of RadFileExplorer but is a general security restriction.

RadFileExplorer can be used to list physical directories that resides on the web server, or on a cloud server or even a file structure stored in a database, but to be able to list these files and / or manipulate them the web server which is running the website need to have the correct permissions.

Regards,
Dobromir
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.

 
0
Ravi
Top achievements
Rank 1
answered on 29 Apr 2014, 01:16 PM
Thank you so much  for giving such valuable information related  to my previous post

but Sir in case  of    <telerik:RadUpload ID="RadUpload1" runat="server">  </telerik:RadUpload>  this  we are able to browse  particular file  of client machine.    but i   don't want to browse particular file    i want to  browse folder (if this folder contain 5 file  i want to upload   all files on server    on folder selection ) of client machine  

Please give me solution of this  problem 

 
0
Marin Bratanov
Telerik team
answered on 02 May 2014, 06:36 AM

Hello Ravi,

Once again - one cannot control the folder the end user is going to browse on their own machine when choosing files to upload. This is a browser restriction. If such control were possible, web pages would have access to the file system, which would be a huge security issue.

If you want to be able to upload multiple files at once - you would need to use RadAsyncUpload: http://demos.telerik.com/aspnet-ajax/asyncupload/examples/multiplefileselection/defaultcs.aspx.


Regards,

Marin Bratanov
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.

 
0
Ravi
Top achievements
Rank 1
answered on 02 May 2014, 12:47 PM
thanks for reply sir

Sir Please  build  google drive folder upload  like  functionality in    asp.net  web project  using    Telerik  control 
 



0
Ravi
Top achievements
Rank 1
answered on 03 May 2014, 10:36 AM
Sir is  there any third party tool  by which we can  upload   folder  in asp.net website   ?  
0
Sudha
Top achievements
Rank 1
answered on 10 Aug 2017, 03:59 AM

Hello ,

I want same functionality for my razor view . Above code is not working for me. I am working in ASP MVC using razor . and my requirement isto select a folder from  folder dialog then populate a kendo grid with the images containg in the selected folder.

 

Please help

0
Rumen
Telerik team
answered on 10 Aug 2017, 04:34 AM
Hi Sudha,

The Telerik UI for ASP.NET AJAX suite is not tested under MVC environments and the controls from the AJAX suite are not supported in an MVC setup.They are based on the web form paradigm and heavily rely on the web form server lifecycle that is not available in an MVC environment.You can only add the AJAX controls to a standard web form in an MVC project. The Razor engine is not supported by the Telerik UI for ASP.NET AJAX controls.

We recommend using the UI for ASP.NET MVC, the Telerik product built from the ground up to support the principles of MVC development in your MVC projects. Since the FileExplorer control is not available in this suite, you can vote for its implementation at http://kendoui-feedback.telerik.com/forums/127393-kendo-ui-feedback/suggestions/3767267-fileexplorer.


Best regards,
Rumen
Progress Telerik
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
FileExplorer
Asked by
Jason Bourdette
Top achievements
Rank 1
Answers by
Dobromir
Telerik team
Jason Bourdette
Top achievements
Rank 1
Fiko
Telerik team
Miguel
Top achievements
Rank 1
July
Top achievements
Rank 2
Ravi
Top achievements
Rank 1
Marin Bratanov
Telerik team
Sudha
Top achievements
Rank 1
Rumen
Telerik team
Share this question
or