How to open local system folder from the browser

Hi All,
I'm working on some stuff, wherein the user downloads the files from internet to his local machine. I'm able to catch the path of the folder where user wants to download the file from SaveAs prompt. Now my requirement is , i want to provide a link button or
a button on the web page and assign this is folder path dynamically so that when the user clicks on it, it should open the local system folder where he has downloaded the files.
string myDocspath
=Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);
string windir
= Environment.GetEnvironmentVariable("WINDIR");
System.Diagnostics.Process prc
= new System.Diagnostics.Process();
prc.StartInfo.FileName = windir + @"\explorer.exe";
prc.StartInfo.Arguments = myDocspath;
prc.Start();
Work fine with local system, if i host the application in IIS , the above code snippet wont work
Thanks in advance,
Suraj Kumar 
Software Engineer

Hello,
 local resources is disabled in all modern browsers due to security restrictions.
 if the reply help you mark it as your answer.
 Free No OLE C#
Word,  PDF, Excel, PowerPoint Component(Create,
Modify, Convert & Print) 

Similar Messages

  • How to open a new window from the login window?

    hi,
    can someone tell me how to open a new window from an existing window, here by window i mean frame. The case is i hv two java files - oracle.java and FDoptions.java. The first frame is in the Login.java. The oracle.java file has a button "Login", when it is clicked, i want to open the next frame which is in the file FDoptions.java. Can some one help me with this? I m giving the code below -
    oracle.java
    import java.awt.BorderLayout;
    import java.awt.FlowLayout;
    import java.awt.GridLayout;
    import java.awt.event.ActionEvent;
    import javax.swing.AbstractAction;
    import javax.swing.BorderFactory;
    import javax.swing.JButton;
    import javax.swing.JFrame;
    import javax.swing.JLabel;
    import javax.swing.JPanel;
    import javax.swing.JPasswordField;
    import javax.swing.JTextField;
    * The application's main frame.
    public class oracle {
        private JFrame frame;
        private JPanel logInPanel;
        private JButton clearButton;
        private JButton logInButton;
        private JButton newuserButton;
        private JButton forgotpasswordButton;
        private JTextField userNameTextField;
        private JPasswordField passwordTextField;
        public oracle() {
            initComponents();
        private final void initComponents() {
            JLabel userNameLabel = new JLabel("User name: ");
            JLabel passwordLabel = new JLabel("Password: ");
            userNameTextField = new JTextField();
            passwordTextField = new JPasswordField();
            JPanel userInputPanel = new JPanel(new GridLayout(2, 2, 5, 5));
            userInputPanel.setBorder(BorderFactory.createEmptyBorder(10, 20, 10, 20));
            userInputPanel.add(userNameLabel);
            userInputPanel.add(userNameTextField);
            userInputPanel.add(passwordLabel);
            userInputPanel.add(passwordTextField);
            logInButton = new JButton(new LogInAction());
            clearButton = new JButton(new ClearAction());
            newuserButton = new JButton(new NewUserAction());
            forgotpasswordButton = new JButton(new ForgotPassword());
            JPanel buttonPanel = new JPanel(new FlowLayout(FlowLayout.CENTER));
            JPanel buttonPanel1 = new JPanel(new FlowLayout(FlowLayout.RIGHT));
            buttonPanel.add(logInButton);
            buttonPanel.add(clearButton);
            buttonPanel1.add(newuserButton);
            buttonPanel1.add(forgotpasswordButton);
            logInPanel = new JPanel(new BorderLayout());
            logInPanel.add(userInputPanel, BorderLayout.NORTH);
            logInPanel.add(buttonPanel, BorderLayout.CENTER);
            logInPanel.add(buttonPanel1,BorderLayout.SOUTH);
            frame = new JFrame("FD Tracker");
            frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            frame.setSize(500, 500);
            frame.setContentPane(logInPanel);
            frame.pack();
            frame.setVisible(true);
        private void performLogIn() {
            // Log in the user
            System.out.println("Username: " + userNameTextField.getText());
            char[] password = passwordTextField.getPassword();
            System.out.print("Password: ");
            for(char c : password) {
                System.out.print(c);
            System.out.println();
        private void performClear() {
            // Clear the panel
            System.out.println("Clearing the panel");
            userNameTextField.setText("");
            passwordTextField.setText("");
        private final class LogInAction extends AbstractAction {
            public LogInAction() {
                super("Log in");
            @Override
            public void actionPerformed(ActionEvent e) {
                performLogIn();
        private final class ClearAction extends AbstractAction {
            public ClearAction() {
                super("Clear");
            @Override
            public void actionPerformed(ActionEvent e) {
                performClear();
        private final class NewUserAction extends AbstractAction{
             public NewUserAction(){
                 super("New User");
             @Override
             public void actionPerformed(ActionEvent e){
                 JFrame newuser = new JFrame("NewUser");
        private final class ForgotPassword extends AbstractAction{
            public ForgotPassword(){
                super("Forgot Password");
            @Override
            public void actionPerformed(ActionEvent e){
                JFrame forgotpassword = new JFrame("Forgot Password");
        public static void main(String args[]) {
            new oracle();
         FDoptions.java
    import java.awt.FlowLayout;
    import java.awt.BorderLayout;
    import java.awt.GridLayout;
    import java.awt.event.ActionEvent;
    import javax.swing.AbstractAction;
    import javax.swing.BorderFactory;
    import javax.swing.JPanel;
    import javax.swing.JButton;
    import javax.swing.JFrame;
    public class Fdoptions{
        private JFrame fdoptions;
        private JPanel fdoptpanel;
        private JButton enterfdbutton;
        private JButton viewfdbutton;
        public Fdoptions() {
            initComponents();
        private final void initComponents(){
            fdoptpanel = new JPanel(new BorderLayout());
            fdoptpanel.setBorder(BorderFactory.createEmptyBorder(80,50,80,50));
            enterfdbutton = new JButton(new EnterFDAction());
            viewfdbutton = new JButton(new ViewFDAction());
           JPanel enterbuttonpanel = new JPanel(new FlowLayout(FlowLayout.CENTER));
           JPanel viewbuttonpanel = new JPanel(new FlowLayout(FlowLayout.CENTER));
            enterbuttonpanel.add(enterfdbutton);
            viewbuttonpanel.add(viewfdbutton);
            fdoptpanel.add(enterbuttonpanel,BorderLayout.NORTH);
            fdoptpanel.add(viewbuttonpanel,BorderLayout.SOUTH);
            fdoptions = new JFrame("FD Options");
            fdoptions.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            fdoptions.setSize(1000,1000);
            fdoptions.setContentPane(fdoptpanel);
            fdoptions.pack();
            fdoptions.setVisible(true);
        private void performEnter(){
        private void performView(){
        private final class EnterFDAction extends AbstractAction{
            public EnterFDAction(){
                super("Enter new FD");
            public void actionPerformed(ActionEvent e){
                performEnter();
        private final class ViewFDAction extends AbstractAction{
            public ViewFDAction(){
                super("View an existing FD");
            public void actionPerformed(ActionEvent e){
                performView();
        public static void main(String args[]){
            new Fdoptions();
    }

    nice day,
    these lines..., despite the fact that this example is about something else, shows you two ways
    1/ modal JDialog
    2/ two JFrame
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    * Parent Modal Dialog. When in modal mode, this dialog
    * will block inputs to the "parent Window" but will
    * allow events to other components
    * @see javax.swing.JDialog
    public class PMDialog extends JDialog {
        private static final long serialVersionUID = 1L;
        protected boolean modal = false;
        private WindowAdapter parentWindowListener;
        private Window owner;
        private JFrame blockedFrame = new JFrame("No blocked frame");
        private JFrame noBlockedFrame = new JFrame("Blocked Frame");
        public PMDialog() {
            noBlockedFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            noBlockedFrame.getContentPane().add(new JButton(new AbstractAction("Test button") {
                private static final long serialVersionUID = 1L;
                @Override
                public void actionPerformed(ActionEvent evt) {
                    System.out.println("Non blocked button pushed");
                    blockedFrame.setVisible(true);
                    noBlockedFrame.setVisible(false);
            noBlockedFrame.setSize(200, 200);
            noBlockedFrame.setVisible(true);
            blockedFrame.setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE);
            blockedFrame.getContentPane().add(new JButton(new AbstractAction("Test Button") {
                private static final long serialVersionUID = 1L;
                @Override
                public void actionPerformed(ActionEvent evt) {
                    final PMDialog pmd = new PMDialog(blockedFrame, "Partial Modal Dialog", true);
                    pmd.setSize(200, 100);
                    pmd.setLocationRelativeTo(blockedFrame);
                    pmd.getContentPane().add(new JButton(new AbstractAction("Test button") {
                        private static final long serialVersionUID = 1L;
                        @Override
                        public void actionPerformed(ActionEvent evt) {
                            System.out.println("Blocked button pushed");
                            pmd.setVisible(false);
                            blockedFrame.setVisible(false);
                            noBlockedFrame.setVisible(true);
                    pmd.setVisible(true);
                    System.out.println("Returned from Dialog");
            blockedFrame.setSize(200, 200);
            blockedFrame.setLocation(300, 0);
            blockedFrame.setVisible(false);
        public PMDialog(Dialog parent, String title, boolean isModal) {
            super(parent, title, false);
            initDialog(parent, title, isModal);
        public PMDialog(Frame parent, String title, boolean isModal) {
            super(parent, title, false);
            initDialog(parent, title, isModal);
        private void initDialog(Window parent, String title, boolean isModal) {
            owner = parent;
            modal = isModal;
            parentWindowListener = new WindowAdapter() {
                @Override
                public void windowActivated(WindowEvent e) {
                    if (isVisible()) {
                        System.out.println("Dialog.getFocusBack()");
                        getFocusBack();
        private void getFocusBack() {
            Toolkit.getDefaultToolkit().beep();
            super.setVisible(false);
            super.pack();
            super.setLocationRelativeTo(owner);
            super.setVisible(true);
            //super.toFront();
        @Override
        public void dispose() {
            owner.setEnabled(true);
            owner.setFocusableWindowState(true);
            super.dispose();
        @Override
        @SuppressWarnings("deprecation")
        public void hide() {
            owner.setEnabled(true);
            owner.setFocusableWindowState(true);
            super.hide();
        @Override
        public void setVisible(boolean visible) {
            boolean blockParent = (visible && modal);
            owner.setEnabled(!blockParent);
            owner.setFocusableWindowState(!blockParent);
            super.setVisible(visible);
            if (blockParent) {
                System.out.println("Adding listener to parent ...");
                owner.addWindowListener(parentWindowListener);
                try {
                    if (SwingUtilities.isEventDispatchThread()) {
                        System.out.println("EventDispatchThread");
                        EventQueue theQueue = getToolkit().getSystemEventQueue();
                        while (isVisible()) {
                            AWTEvent event = theQueue.getNextEvent();
                            Object src = event.getSource();
                            if (event instanceof ActiveEvent) {
                                ((ActiveEvent) event).dispatch();
                            } else if (src instanceof Component) {
                                ((Component) src).dispatchEvent(event);
                    } else {
                        System.out.println("OUTSIDE EventDispatchThread");
                        synchronized (getTreeLock()) {
                            while (isVisible()) {
                                try {
                                    getTreeLock().wait();
                                } catch (InterruptedException e) {
                                    break;
                } catch (Exception ex) {
                    ex.printStackTrace();
                    System.out.println("Error from EDT ... : " + ex);
            } else {
                System.out.println("Removing listener from parent ...");
                owner.removeWindowListener(parentWindowListener);
                owner.setEnabled(true);
                owner.setFocusableWindowState(true);
        @Override
        public void setModal(boolean modal) {
            this.modal = modal;
        public static void main(String args[]) {
            new PMDialog();
    }

  • How do you copy and paste from the browser?

    how do you copy and paste from the internet browser on the n97?

    Guys, just to be sure, there is no solution so far for this prob right? not even with 3rd party apps??

  • How to Open a Specific Folder in the Finder via Shortcut Key

    I'm sure this has been covered elsewhere, so sorry for not finding it...
    Is it possible to assign a shortcut key to open a specific folder with Automator or AppleScript? There are 4-5 commonly used folders buried 10-11 levels deep on a server and I'd love to have a shortcut key to open those particular folders in the Finder.
    Could you give me some assistance?
    Thanks!

    QuickKeys may work, or you can look on http://www.versiontracker.com or http://www.macupdate.com for other alternatives.
    Another option is to create aliases to those folders and store the aliases in a local folder which you can place on your Dock, the Finder window sidebar or toolbar.

  • How to open file system file from Apex?

    Hi,
    Can someone help me to find how to open a pdf file e.g. test.pdf from apex when someone click on a button ABC?
    The file is located in /C/
    Thanks in advance
    Dip

    You can use the Onclick event and window.location to show the file when the user clicks a button.
    <input type=button onClick="window.location= 'file:///C:/Documents%20and%20Settings/rchamarthi/Desktop/test.pdf' + document.form1.cmuds.value;" value="Open File">The actual location of the file is "C:/Documents and Settings/rchamarthi/Desktop/test.pdf"
    Since the location is treated as a URL, remember that it should be URL encoded.
    Hence all spaces should be replaced by '%20' (32 being the ASCII for space and 20 in hex -> 32).

  • How can I access files saved from the browser on my tablet? Doesn't open files?

    I tried to save a document on my tablet but in the downloads place in the browser it wouldn't open. I thought it was OK cause maybe the doc format, but I just tried to save a photo and when I tried to open it, it said "unable to find the default app."
    How can I get the photo on my tablet under pictures or something?  Do I need to download a special app?

    WMA files from libraries usually if not always contain DRM, which makes it impossible.
    (59943)

  • How can I start System Preferences from the command line?

    Hello All,
    I have an issue I'm not quite sure how to solve. I have been tasked within my business environment  with tightening security on a Mac Leopard system and I've been granted Admin Rights to do this on a temporary basis.
    The problem is as follows:
    1) The original Sys Admin that set up this system is gone, no longer available.
    2) He was a Dvorak Keyboard fan and set up the system for a Dvorak Keyboard.
    3) The system actually has a standard Apple keyboard and is marked accordingly, i.e., qwerty (Most Users in the building have stopped using this system altogether - a terrible waste of a good system - even though some of their apps can be run normally (US style qwerty settings). The command line is useless, as is texteditor.app and a few others unless you know Dvorak layout)
    5) When I open System Preferences, the Dvorak keyboard checkbox is grayed out and I cannot change it. There is no lock at the bottom of that particular screen for me to unlock.
    6) Even though I select the US Keyboard at Login, and some apps work accordingly (like MatLab for example) the terminal is borderline useless. I spent over 2 hrs yesterday doing what should have been able to be done in about 30 minutes. I estimate a frustrating and mistake prone additional 8 to 10 hours to do what is normally a a 4 hour job at the command-line.
    7) I do not have the time or desire to re-mark all the keys on the keyboard, particularly since it is not my call to do so, nor do I have the time to re-learn Dvorak touch-typing, and finally I do not want to re-load the entire system. I just want to change the darn keyboard to a standard qwerty keyboard that is somewhat useful in a terminal environment with vi, command line, etc. It's either that or I go mildly insane
    This is frustrating as all get-out. The new Admin logged in and was able to uncheck his Dvorak settings (he is not a UNIX guy, nor is he comfortable om Macs), and we were hoping this was a system wide setting, but No. We re-booted the system, I logged in, still Dvorak, and the checkbox was still grayed out.
    So I figure, short of re-loading the entre system and all the applications necesary, I can either start the Systems Preferences GUI using sudo and hopefully that will change system-wide settings, or I can delete the .AppleSetupDone file and resetup the system (if the keyboard settings are part of the setup) without spending a couple of days reloading everything and re-setting up users, networks, etc.
    Needless to say, I am hoping for the easiest and quickest solution to this extremely frustrating and  aggravating problem.
    Thanks.

    For my situation the following C# code does the job:
        Process.Start(
           @"c:\Program Files\National Instruments\CVI71\cvi.exe",
           @"c:\temp\experiment.c" );
    The file must already exist.

  • How to open files in MIDP (from the jar file)?

    Hello,
    I can't seem to figure out how to open a file that is in my MIDP applications jar-File.
    From what I've found via Google, I assume that the way to do it should be by using
    Connector.openInputStream("file:{path_to_my_file}")
    but I only get the error
    java.lang.ClassNotFoundException: com.sun.midp.io.j2me.file.Protocol
    (Running the Emulator from Suns WTK 2.0 with DefaultColorPhone)
    I've also tried file:// with the same result.
    Any ideas?
    Many thanks in advance!
    Bjoern

    I think I've found something that looks promising now:
    Class.getResourceAsStream()

  • How to delete a shortcut favorite from the browser in the WORK Area

    Hiho,
    creating a shortcut favorite icon of a browser-website in the work area shows up a symbol to use this shortcut. In the private area I can delete this favorite-symbol by tapping longer on the icon an a trashcan shows up, so I can delete the icon (and the browser favorite from the private area). Not so in the work (buisiness) part of the BlackBerry, there is no possibility to delete this icon. I can't find a policy on the BES10 server or thomething on the Z10, any ideas how i can remove the icon?
    Greetings... Ifrani

    Hi Ifrani!
    I´ve the same problem on my Z10!
    CommanderApollo

  • How do you retrieve a certificate from the browser(say firefox) cert store?

    I want to retrieve certficate from the firefox certificate store and to use the same in jvm context to avoid the popup for certficate acceptance again and again( in case of reauthentication )..
    can anybody help me..
    thnx..

    Firefox stores its certificate in a file called cert8.db. On the Linux/UNIX environment, this file is in a subdirectory of your $HOME directory called .mozilla/. On Windows, it is typically in the c:\Documents and Settings\<User>\Application Data\Mozilla\Firefox\Profiles\<Random Hash Value>\ directory.
    Before you load the keystore, I am assuming you have configured the SunPKCS11 JCE Provider in your java.security file, and have gotten an instance of the provider using the KeyStore.getInstance("PKCS11") call. You should only have one PKCS11 providrer in java.security for this to work.
    While the configuration file for JDK6 has changed a little bit, the concept and capability has not. If you're having trouble with JDK6, I would recommend trying it out on JDK5 first and making sure it works on your machine, and then trying it with JDK6. The source code in the keystoreLoaderHelper.java file in the SKCL module of the StrongKey source distribution (www.strongkey.org) has all the code in it that shows how to load keys/certificates using the Firefox and the JKS keystores.

  • How To Delete a User Folder from the Catalog?

    When logged into the Catalog Manager as the Administrator I am not allowed to delete individual user folders, even when the user has been deleted via the 'Manage Presentation Catalog Groups and Users' link in the front end. If the Administrator user cannot do this, who can? I also can't do it if I log into the Catalog Manager as the specific user (and I also can't change the permissions on that users folder, as that user!).
    Any ideas? Thanks.

    Your second option doesn't work for me. I've got no ability to drill into the individual user folders or change their permissions. The normal padlock button is not next to any of the user folders except the Administrator folder.
    I didn't have the ability to take OBI down so I could try using the Catalog Manager offline, so I deleted the user folders in the file system directly.

  • How do I remove a folder from the sidebar if it has already been deleted?

    I recently bought a Macbook Pro and migrated my files and profile from my Mac Mini.
    The problem is, on my Mini, I had some folders in the sidebar that linked to folders on a different partition which isn't present on my Macbook Pro.
    So now when I try to get rid of those folders on my Macbook Pro, I just get "open sidebar preferences" and not a "remove from sidebar".
    Does that make sense?

    Hold CMD while you drag it off.
    Regards
    This was a change with 10.6.7

  • Need help! how to open a shared folder thru web browser

    Hi to all LV'ers,
    as the subject implies, i am trying to find a way to view the shared folder w/in the company network thru web browser. is this possible? is there a much easy way?? i never been used FTP vi's before or any other vi's to deal with this situation but i successfully used web publishing tool to make an access of LV front panel remotely using "web publishing tool". btw, im using LV 8.5.1.
    my purpose for this is to let our boss to have a quick access of the data from excel files (w/ "s" because many excel file report is generated everyday for data updates) resided in remote computer (this computer runs the LV program and we can view its front panel remotely thru web publishing tool but i also need to view the folder of this computer that contains files). that is why im finding a way to have an access not only a specific excel file but a specific folder. ofcourse, we can access the shared folder thru "my network places>>entire network>>microsoft windows network" if the folder is shared but our boss is far more convenient if we LV programmers can create a button to automatically lead them to the folder containing files they needed.
    I hope anyone already done dealing with this can shared their solutions.
    deeply appreciate your help!!
    regards,
    ivel
    Ivel R. | CLAD
    Solved!
    Go to Solution.

    i think what i told in my 1st msg makes things more complicated than what i really need, sorry for that.. but for sure, i need this to be done in LV because the data from excel files was generated by LV program and this LV program is displayed in our web (thru web publishing tool), see picture below.
    what i want to do is to add a button here in front panel that when pushed, will show the folder consisting of several excel files. with this, i can choose what particular excel file to be opened. sorry guys i make you confused in my situation. here i attached i simple VI to let me open the excel file but unfortunately when i select the desired excel file, the dialog says "path not found". when i browse and open the excel file manually using "entire network>>microsoft windows network>>remote computer name>> shared folder>>excelfile", i can successfully opened it.
    i dont know why i cannot make a valid path using my attached vi. maybe there's something wrong with my program,please let me know. the attached vi is LV 8.5.1. i will used this vi as a subvi later in the front panel shown above.
    thanks in advanced for help..!
    Ivel R. | CLAD
    Attachments:
    Untitled 2.vi ‏44 KB

  • How do I get my ICloud from the browser to my dock?

    I dont mind going on my browser to access my icloud but it would make it more convienent to have it directly on my dock

    The nearest you can get is to drag the little Apple icon in the aqddress bar to the right-hand side of the Dock:
    In effect this is just a bookmark, but it gets you straight to iCloud on one click.

  • HT4061 how do you do a system reboot from the computer when your phone is not working

    I would like to know how to do a system reboot from the computer. The Verison rep said that is what I need to do to fix my phone but they did not have the equipment to do so.

    Do you mean restore your phone?  You'll need itunes on your computer, plug your phone to your computer open itunes and select restore.

Maybe you are looking for

  • Reffering to Code in root timeline

    I'm very suprised I theres not an obvious answer to this question to be found. In AS 2 I would often write most of my code in the main timeline, and then refer to it from various other movies etc. I dont seem to be able to do that in AS 3? how can I

  • Jco report error

    when i use jco to connect r3,call bapi "BAPI_DOCUMENT_CHECKOUTVIEW2" it reports the following errors: com.sap.mw.jco.JCO$AbapException: (126) NO_DOC_TYPE: NO_DOC_TYPE      at com.sap.mw.jco.JCO$Function.getException(JCO.java:18195)      at com.sap.mw

  • Need an efficient way to write history record

    I need to keep the old images of the records in table A after any changes made by the user. So, I create a history table B which is exactly the same as A but have two more columns to store the the SYSDATE & USER. Currently, my program uses a cursor t

  • SoundLogic Telescopic Lens attached to the iPhone

    My Wife just bought me the SoundLogic iPhone Telescopic Lens with the detachable case and Tripod. A fun little Valentine's Day Present. Of course I've been testing this lenses ability & I've found that while the box claims it is an 18mm lens it seems

  • Aperture 2.0 - first impressions are very good!!

    I downloaded and installed the trial. My hobby is underwater photography so I need an application that provides flexibility with expose. I have imported photos and I am very impressed with how they have turned out. Aperture 2.0 is the best I have use