Specifying a FilePath & Name to Read From & Write To

4 posts, 0 answers
  1. Robert
    Robert avatar
    253 posts
    Member since:
    Aug 2007

    Posted 19 Jul 2013 Link to this post

    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.
  2. Robert
    Robert avatar
    253 posts
    Member since:
    Aug 2007

    Posted 19 Jul 2013 Link to this post

    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


  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Vessy
    Admin
    Vessy avatar
    1382 posts

    Posted 24 Jul 2013 Link to this post

    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.
  5. Robert
    Robert avatar
    253 posts
    Member since:
    Aug 2007

    Posted 24 Jul 2013 Link to this post

    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

Back to Top