Hi.
I have on my computer a program that reads a local text file. It
used to work OK but now it doesn't and the Web Developer Tools
of Firefox says:
Cross-Origin Request Blocked: The Same Origin Policy disallows
reading the remote resource at file:///C:/...
Is there any work-around?
emf:
Hi.
I have on my computer a program that reads a local text file. It
used to work OK but now it doesn't and the Web Developer Tools
of Firefox says:
Cross-Origin Request Blocked: The Same Origin Policy disallows
reading the remote resource at file:///C:/...
Is there any work-around?
No.
Accessing local files is restricted for security reasons.
Also see: <https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS/Errors/CORSRequestNotHttp>
On 20/07/2022 00:34, Arno Welzel wrote:
emf:I wouldn't be as categorically sure as all that.
Hi.
I have on my computer a program that reads a local text file. It
used to work OK but now it doesn't and the Web Developer Tools
of Firefox says:
Cross-Origin Request Blocked: The Same Origin Policy disallows
reading the remote resource at file:///C:/...
Is there any work-around?
No.
I can think of at least one way.
Construct a minimal web server on the local machine and access it via ajax.
The Natural Philosopher:
On 20/07/2022 00:34, Arno Welzel wrote:
emf:I wouldn't be as categorically sure as all that.
Hi.
I have on my computer a program that reads a local text file. It
used to work OK but now it doesn't and the Web Developer Tools
of Firefox says:
Cross-Origin Request Blocked: The Same Origin Policy disallows
reading the remote resource at file:///C:/...
Is there any work-around?
No.
I can think of at least one way.
Construct a minimal web server on the local machine and access it via ajax.
For this you need Node.js:
<https://nodejs.org/api/http.html#http_http_createserver_options_requestlistener>
Or setup Apache2 or Nginx.
I'm not sure if I'd call this a "workaround". To me this seems to be a completely different approach - don't access locally but using a webserver.
Hi.
I have on my computer a program that reads a local text file. It
used to work OK but now it doesn't and the Web Developer Tools
of Firefox says:
Cross-Origin Request Blocked: The Same Origin Policy disallows
reading the remote resource at file:///C:/...
Is there any work-around?
Thanks,
Eustace
--
It ain't THAT, babe! — A radical reinterpretation https://emf.neocities.org/bd/itaintmebabe.html
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 357 |
Nodes: | 16 (2 / 14) |
Uptime: | 73:19:30 |
Calls: | 7,664 |
Calls today: | 3 |
Files: | 12,822 |
Messages: | 5,705,485 |