Good day!

Is it possible to access the local file from an application or extension under Chrome using the following paths:

  • file: /// C: \ Folder \ File.jpg
  • C: \ Folder \ File.jpg

When you try to create a File () object from a local link, errors appear:

For a full explanation of this question, see my answer.

    2 answers 2

    A Chrome app or extension cannot access the local file directly, as this would be a serious security breach. Of course, this limitation can be circumvented , as I was explained on stackoverflow via Native host . True, I personally did not try to do this, since I solved my problem simply by storing local files inside Indexed BD. Read more about all the ways I know how to store files and follow up with them, read on.

    Work with files through Indexed BD.

    • How to save file in indexedbd? An answer with explanations here .
    • How to get the file over the network and save to indexedbd? The answer is here .

    We use FileSystem API for saving and working with files.

    Local Storage & Session Storage & Cookie Storage

    You can get the files (their objects) to work with them via drag & drop or <input type="file" /> . You can read more about how this is done with examples and subsequent debriefing here .

    I hope that the answer explained at least superficially about working with files in applications and Google Chrome extensions.

      Here you need a little bit different.
      Try the way

       file://C :/0.JPG