I have tried to read a simple text file, whose URI is C:\reading.txt, in my computer through AJAX:
fetch("C:/reading.txt");
Web browser throws an exception during test of above statement and says:
Access to fetch at 'file:///C:/reading.txt' from origin 'null' has been blocked by CORS policy: Cross origin requests are only supported for protocol schemes: http, data, chrome-extension, edge, chrome-untrusted, https, isolated-app.
I have tried this in Firefox, Chromium and Internet Explorer. All of them gave similar messages. Accessing local storage via AJAX may be dangerous, but I am just developing an offline application. Could we pass this restriction?
Protest against closing...
The application told here is not a network application. Thus, we can not apply HTTP on application layer. To do this the application must be published in a server technology like IIS, Apache Tomcat, JBoss etc. Pointed thread mentions web based applications, so it does not answer my question.