Do more on the web, with a fast and secure browser!

Download Opera browser with:

  • built-in ad blocker
  • battery saver
  • free VPN
Download Opera

Allow file access from files

  • In previous versions used to be a configuration / flag to allow file access from files. After it went away, people suggested to use the command line parameter --allow-file-access-from-files like with Chromium.

    Neither of the options seems to work for me. How can I enable file access?

  • Could you provide a test case? You using XHR to read file file? Is the file is the same directory (or subdirectory) as the HTML file?

  • The test case is as follows: I have a XML file with a transformation element specifying a XSL file. In Opera the screen stays blank, in Firefox the XML is rendered as expected. From my research I could exclude that there are other reasons responsible than the disallowance of local file access.

  • Seems to be working fine for me on Windows 10 Pro + opera 52.0.2871.64 x64 where both files are on my desktop.

    launcher.exe --allow-file-access-from-files
    

    cdcatalog.xml:

    <?xml version="1.0" encoding="UTF-8"?>
    <?xml-stylesheet type="text/xsl" href="cdcatalog.xsl"?>
    <catalog>
      <cd>
        <title>Empire Burlesque</title>
        <artist>Bob Dylan</artist>
        <country>USA</country>
        <company>Columbia</company>
        <price>10.90</price>
        <year>1985</year>
      </cd>
      <cd>
        <title>Hide your heart</title>
        <artist>Bonnie Tyler</artist>
        <country>UK</country>
        <company>CBS Records</company>
        <price>9.90</price>
        <year>1988</year>
      </cd>
     </catalog>
    

    cdcatalog.xsl

    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:transform version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:template match="/">
    <html> 
    <body>
      <h2>My CD Collection</h2>
      <table border="1">
        <tr bgcolor="#9acd32">
          <th style="text-align:left">Title</th>
          <th style="text-align:left">Artist</th>
        </tr>
        <xsl:for-each select="catalog/cd">
        <tr>
          <td><xsl:value-of select="title"/></td>
          <td><xsl:value-of select="artist"/></td>
        </tr>
        </xsl:for-each>
      </table>
    </body>
    </html>
    </xsl:template>
    </xsl:transform>
  • Windows 10 Pro 64 bit, Opera 52.0.2871.40, both files on my desktop, invoked as you suggested: blank screen.

    Let me guess: "Try uninstalling and reinstalling Opera" ? 🙂

  • @vince42 said in Allow file access from files:

    Try uninstalling and reinstalling Opera" ?

    🙂 You can test in a standalone installation instead. Download the Opera installer, launch it, click "options", set "install path" to a folder on your desktop, set "install for" to "standalone installation" and install. See how it works in that Opera. If it works fine, then you know something is not quite right with your regular install/profile.

  • Actually, I think, I will not undergo the effort to find out what goes wrong, when there is only a command line switch to toggle the behaviour. I rather stick to Firefox for development then. Hopefully it gets integrated in the future again.

Log in to reply
 

Looks like your connection to Opera forums was lost, please wait while we try to reconnect.