0

I'm trying to display a PDF but it's impossible.

The only thing that the console returns is this : Not allowed to load local resource: file://XX.XXX.XX.XX/folder/mypdf.pdf

Here's my code :

<a href='file:\\\\XX.XXX.XX.XX\\folder\\mypdf.pdf'>Click to see the PDF</a>

Do you have any ideas?

Hashka
  • 395
  • 3
  • 10
  • 1
    Does this answer your question? [Cannot open local file - Chrome: Not allowed to load local resource](https://stackoverflow.com/questions/39007243/cannot-open-local-file-chrome-not-allowed-to-load-local-resource) – CBroe Jul 08 '21 at 12:13
  • I'm not using a local server actually – Hashka Jul 08 '21 at 12:14
  • Well, yeah, that is why you are getting the error message … – CBroe Jul 08 '21 at 12:15
  • So if I don't use a local server, I'm gonna have a "Not allowed to load local resource" ? I mean, nothing is "local", the PDF is not local – Hashka Jul 08 '21 at 12:17
  • `file://` in itself means “local” to the browser, it is a pseudo protocol for accessing file systems. Whether you try to use that to access some mapped network drive or whatever, doesn’t make a difference. – CBroe Jul 08 '21 at 12:21
  • Well, maybe, but it doesn't tell me (even in the following link) how to counter that – Hashka Jul 08 '21 at 12:26
  • It already tells you that you have the option to start a browser like Chrome with a flag (if you need this in a local environment you have control over only), or that you will need to proxy the file through some kind of HTTP server instead. And if neither of those are viable options for you - well, a simple “what you want is not possible” sometime just _is_ the answer. – CBroe Jul 08 '21 at 12:32

0 Answers0