Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4074564
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T17:11:14+00:00 2026-05-20T17:11:14+00:00

In my web page I have a file link to the local drive folder.

  • 0

In my web page I have a file link to the local drive folder. Such as:

<a href="D:\folder\file.txt">file.txt</a> 
<a href="D:\folder>folder</a>

In normal ways, it isn’t possible to open folder from web browser. So, I thought I can do it from a Firefox extension, because I am using Firefox in my job.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T17:11:14+00:00Added an answer on May 20, 2026 at 5:11 pm

    To open folder you can use function:

    function openDir(val)
    {
        if (val == "")
        {
            alert("Directory not defined");
            return;
        }
        if(navigator.userAgent.indexOf("Firefox") == -1)
        {
            alert("Currently active folder links supported only for Mozilla Firefox web browser");
            return;
        }
        netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
        var localFile = 
            Components.classes["@mozilla.org/file/local;1"]
            .createInstance(Components.interfaces.nsILocalFile);
    
        var env =
            Components.classes["@mozilla.org/process/environment;1"]
            .createInstance(Components.interfaces.nsIEnvironment);
    
        var systemRoot = env.get("SystemRoot");
        if (systemRoot == "")
        {
            alert("Unable to retrieve SystemRoot environment variable");
        }
    
        localFile.initWithPath(systemRoot + "\\explorer.exe");
        var process =
            Components.classes["@mozilla.org/process/util;1"]
            .createInstance(Components.interfaces.nsIProcess);
        process.init(localFile);
        process.run(false, Array(val), 1);
    }
    

    The file read method is shown in nhnb answer, the write method looks like:

    // Returns null if it can't do it, false if there's an error, true if it saved OK
    function mozillaSaveFile(filePath,content)
    {
        if(window.Components) {
            try {
                netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
                var file = Components.classes["@mozilla.org/file/local;1"].createInstance(Components.interfaces.nsILocalFile);
                file.initWithPath(filePath);
                if(!file.exists())
                    file.create(0,0664);
                var out = Components.classes["@mozilla.org/network/file-output-stream;1"].createInstance(Components.interfaces.nsIFileOutputStream);
                out.init(file,0x20|0x02,00004,null);
                out.write(content,content.length);
                out.flush();
                out.close();
                return true;
            } catch(ex) {
                return false;
            }
        }
        return null;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a web page with swf file defined this way <object width=600 height=400
I have downloaded the web page into an html file. I am wondering what's
I have a web page where it will input an excel/CSV file from the
I have to login into a https web page and download a file using
How can i set default home page in asp web.config file. i have already
On my webpage, I have placed a link to a local file (e.g. text.docx
On my web page I have a list of files. Each file is in
I have a scenario where I want a web page to contain a <link>
I am giving link of a pdf file on my web page for download,
I have a delete file link on a page: <form id=myForm runat=server> <asp:LinkButton ID=deleteFileLink

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.