Closed Juniuz closed 6 years ago
The file needs to be on the same server or you have to use CORS.
If you want to serve files from a different server, you have to request those files via a path on the same server as you are on. For example: //get_from_network?path=\server2\main\transfer
So you need to write a custom component on your server to proxy to the files. This is a limitation because of web security.
Hi there,
I have used ViewerJS in my web app and the library is perfect for viewing pdf files in the browser. The document files that are being rendered are saved inside a folder that reside in the web root folder of the web server. Having said that, my web app also requires to load/render files located from a network shared folder. Is this doable in ViewerJS?
Example below are links that is used to load pdf file
http://server/myWebApp/ViewerJS/#../files/testfiles/lab_report_test.pdf - lab_report_test.pdf file is saved in files/testfiles folder path inside the web root folder. This works correctly.
However, this link http://server/myWebApp/ViewerJS/#\\server2\main\transfer\test\lab_report_test.pdf file is located in a network folder path \\server2\main\transfer\test. This path doesn't render the pdf file.
Any help is greatly appreciated.