locked
opening a local folder browser from web browser RRS feed

  • Question

  • User-359936451 posted

    I know this shouldn't be as hard as I have found it to be, but I could use some help on a problem. I have used, and am familiar with the FileUpload control, works great.

    But now I have a need to allow the user to choose a folder path without selecting a file. Basically a folder location, on the local hard drive where my code will read the files located in the choosen folder and process against them.

    I am drawing a total blank and my web searches are not giving me what I am looking for.

    I initiallially developed this with a Windows FolderDialogBrowser control, but it will not run on the web server, likely a security issue, and I can not change it.

    Public Class FolderBrowserDialogExampleForm
        Inherits Form
    
        Private folderBrowserDialog1 As FolderBrowserDialog
        Private openFileDialog1 As OpenFileDialog
    
        Private richTextBox1 As RichTextBox
    
        Private mainMenu1 As MainMenu
        Private fileMenuItem As MenuItem
        Private WithEvents folderMenuItem As MenuItem, _
                           closeMenuItem As MenuItem, _
                           openMenuItem As MenuItem
    
        Private openFileName As String, folderName As String
    
        Private fileOpened As Boolean = False

    Is there some way to open the folder browser on the local machine, from a web browser? I'm not looking to salvage the code above unless there is a reasonable fix.

     

    Tuesday, November 8, 2011 2:44 PM

Answers

  • User-1528094326 posted

    I've never seen a built in browser window that does this much like the FileUpload control as it opens a file dialog window that is built into the browser, not the HTML or anything like that.

    You are pretty much looking at developing some type of control that will have access to the client side materials. You can create one using Javscript like this example here:

    http://www.tek-tips.com/faqs.cfm?fid=5201

    Or you could look at some other alternatives such as Silverlight. There are many controls for silverlight that will do this kind of thing as well.

    Keep in mind using the Javascript stuff or many others may require the user to grant permission before it can run.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, November 8, 2011 6:19 PM
  • User-359936451 posted

    It seems you are mostly correct. For security purposes I guess, it is impossible to process against files on the local PC. I changed this process slightly to allow the users to place the files on the web server, were the web app can process data against them.

    It seems to work fairly well now. It takes a bit more set up on the user side but the end result is that the web data is being exported to the access dbs and they can inturn be deployed as needed.

    thanks for the response.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, November 10, 2011 2:12 PM

All replies

  • User-1528094326 posted

    I've never seen a built in browser window that does this much like the FileUpload control as it opens a file dialog window that is built into the browser, not the HTML or anything like that.

    You are pretty much looking at developing some type of control that will have access to the client side materials. You can create one using Javscript like this example here:

    http://www.tek-tips.com/faqs.cfm?fid=5201

    Or you could look at some other alternatives such as Silverlight. There are many controls for silverlight that will do this kind of thing as well.

    Keep in mind using the Javascript stuff or many others may require the user to grant permission before it can run.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, November 8, 2011 6:19 PM
  • User-359936451 posted

    It seems you are mostly correct. For security purposes I guess, it is impossible to process against files on the local PC. I changed this process slightly to allow the users to place the files on the web server, were the web app can process data against them.

    It seems to work fairly well now. It takes a bit more set up on the user side but the end result is that the web data is being exported to the access dbs and they can inturn be deployed as needed.

    thanks for the response.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, November 10, 2011 2:12 PM