locked
How to access local folder with LightSwitch HTML Application RRS feed

  • Question

  • Hi Everyone 

    I'm having trouble to get access to local folder within lightswitch application. 

    I'm try to create a File:/// link. When click that link it will access to the folder. 

    I'm using Visual Studio 2013

    Please Help.

    Tuesday, July 28, 2015 7:20 AM

Answers

  • Hi Ernest,

                

    Please try with following code to open SelectFileWindow to select local folder. The detailed steps about saving files to file system with LightSwitch, please refer to this article:
    http://lightswitchhelpwebsite.com/Blog/tabid/61/EntryId/35/Saving-Files-To-File-System-With-LightSwitch-Uploading-Files.aspx

                // To invoke our own dialog, we have to do this inside of the "Main" Dispatcher
                // And, since this is a web application, we can't directly invoke the Silverlight OpenFileDialog
                // class, we have to first invoke our own Silverlight custom control (i.e. SelectFileWindow)
                // and that control will be able to invoke the OpenFileDialog class (via the Browse button)
                Dispatchers.Main.BeginInvoke(() =>
                {
                    SelectFileWindow selectFileWindow = new SelectFileWindow();
                    selectFileWindow.Closed += new EventHandler(selectFileWindow_Closed);
                    selectFileWindow.Show();
                });

      




    Best Regards,
    Weiwei

    • Marked as answer by Angie Xu Friday, August 7, 2015 2:51 AM
    Wednesday, July 29, 2015 7:51 AM
    Moderator