Answer the question
In order to leave comments, you need to log in
How to access a local file from a Chrome app?
I am writing an application for Chrome, I save the images added by the user to the database, or rather links to them, so that the user can continue working with them later. But the images are not displayed in the application window.
If you get the links in their pure form: "C:\Images\myjpeg.jpg" Chrome gives the following exception: "Not allowed to load local resource: C:\Images\myjpeg.jpg (if you add file:///, the situations will not change ). Ok, it turns out that you need to turn links into a File object, and then into a special URL object and then display, but for some reason this does not happen. It forms a link, it is attached correctly to img, but is not displayed.
var newURL = window.webkitURL.createObjectURL(new File([],"C:\Images\myjpeg.jpg",{type: "image/jpeg"}));
Answer the question
In order to leave comments, you need to log in
https://github.com/tantaman/LargeLocalStorage
Demo
tantaman.github.io/LargeLocalStorage/examples/album
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question