Mickstjohn09
Mickstjohn09

Reputation: 113

how to open a local file in mozilla firefox using only HTML?

I am trying to open a file which is on the local disk on firefox using html on a ubuntu machine. But, I am facing file not found error. My code is as follows:

    <body>
        <a href="/home/abc/workspace/logfile.log">LOG FILE</a>
    </body>

I tried using file:/// but still the file is not getting opened.

Upvotes: 4

Views: 12094

Answers (2)

meskobalazs
meskobalazs

Reputation: 16041

Use the file:/// protocol:

file:///home/abc/workspace/logfile.log

It does not work however for security reasons in a general case. You can disable the security check by editing about:config, or by using an extension, however I would not recommend it.

This is the about:config key:

security.fileuri.strict_origin_policy

It is true by default, you can set it to false.

Upvotes: 12

Paran0a
Paran0a

Reputation: 3447

You cannot access file system using the browser. For obvious security reasons.

Upvotes: -3

Related Questions