PDF Signature - RadPdfViewer not able to pull file from network file server

1 Answer 23 Views
Ajax PdfViewer Signature
Disposable Hero
Top achievements
Rank 1
Iron
Disposable Hero asked on 23 May 2024, 02:22 PM

Hi,

I'm testing the PDF Signature demo shown in this Telerik example PDF Signature demo. The issue I'm having is I cannot pull a pdf that resides on a network file server where we store all common files. I have no issues loading a pdf on my localhost machine. 

From what I can tell, the issue appears to be the third party opensource pdf.js file Telerik is using in demo that seems confined to only load pdf's from directories within the web application and it's sub-folders defined in IIS for the website. Also, the network file server is used everywhere within our web application so it's not a security issue. 

The error I get from pdf.js is "Not allowed to load local resource" which results in page prompt "PDF file fails to process." display. 

We have an existing web.config entry that looks like this:

<add key="AttachmentsShare" value="\\my_file_server\file"/>

I've tried calling the file server a few different ways with no luck.

RadPdfViewer1.PdfjsProcessingSettings.File = ConfigurationManager.AppSettings("AttachmentsShare") & "1234.pdf"

RadPdfViewer1.PdfjsProcessingSettings.FileSettings.Url = ConfigurationManager.AppSettings("AttachmentsShare") & "1234.pdf"

Please advise. Thanks. 

1 Answer, 1 is accepted

Sort by
0
Disposable Hero
Top achievements
Rank 1
Iron
answered on 24 May 2024, 03:49 PM

I think I found the answer to my own question. Looks like you can resolve this issue by creating a virtual directory within your web application in IIS and setting the Physical Path to \\my_file_server\file. In my demo I called the virtual directory "vdFileShare". 

RadPdfViewer1.PdfjsProcessingSettings.File = "/vdFileShare/1234.pdf"

Virtual Directory in IIS

Rumen
Telerik team
commented on 27 May 2024, 02:06 PM

Yes, the virtual directory pointing the root of the app is one of the approaches shared in the following blog post: 5 Different Approaches of Setting up the Content in RadPdfViewer for ASP.NET AJAX -> File Stored on the Host Machine, Out of the App Folder.
Tags
Ajax PdfViewer Signature
Asked by
Disposable Hero
Top achievements
Rank 1
Iron
Answers by
Disposable Hero
Top achievements
Rank 1
Iron
Share this question
or