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

Specifying a FilePath & Name to Read From & Write To

3 Answers 75 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Robert
Top achievements
Rank 1
Robert asked on 19 Jul 2013, 08:59 PM
From my C# / ASP.Net 4.0 app, I want to be able to display a file dialog box (the simple type that is very common in WinForms apps).  Once the path & filename have been selected then I will either import data from a CDF text file or export data to it.

I've researched the subject and can't seem to find a solution that works to allow me to specify such a dialog box.  I'm thinking that perhaps Telerik has a control to do this but am not sure which one it is.

Any ideas would be much appreciated!

Robert W.

3 Answers, 1 is accepted

Sort by
0
Robert
Top achievements
Rank 1
answered on 20 Jul 2013, 02:33 AM
Further to my original post, I've taken the liberty of starting with code found here: http://demos.telerik.com/aspnet-ajax/fileexplorer/examples/client-sideapi/fileselectordialog/defaultcs.aspx#qsf-demo-source and expanding it a little to achieve this demo project: http://mwtech.com/downloads/public/ExportFileDemo.zip

So I'm getting closer to achieving a generic File Selector.  What I'm currently stuck on in the demo project is that the scope of the folders is restricted to only the website files.  What I really need is a more generic File Dialog that allows the user to specify any path on the user's computer.  Is this possible or am I coming up against a security model?

In the bigger picture, if you had the requirement of having the user specify a text file to Import from and Export to, how would you go about it?

Robert


0
Vessy
Telerik team
answered on 24 Jul 2013, 04:36 PM
Hello Robert,

I am afraid I have to disappoint you, but 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.

Creating such solution will not be a trivial task and in general case such functionality is impossible to be achieved. It is not possible to freely browse client's hard drive using JavaScript, because this will be a major security breach - actually, if this was possible, imagine how easy will be to get access to a client's personal information such as passwords, bank accounts, etc.

By design RadFileExplorer works only with virtual paths to folders placed inside the application root.
It 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,
Veselina Raykova
Telerik
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 the blog feed now.
0
Robert
Top achievements
Rank 1
answered on 24 Jul 2013, 04:48 PM
Hi Veselina,

Thank you for your response.  It's several days later now and I've done more research into what I'm trying to accomplish.  I believe what I need to be done can be done with your AsyncUpload control.  I've made some progress but am stuck at one critical point.  So I submitted a support ticket: #719372

Hopefully you or one of your colleagues can help me with that,

Robert

Tags
General Discussions
Asked by
Robert
Top achievements
Rank 1
Answers by
Robert
Top achievements
Rank 1
Vessy
Telerik team
Share this question
or