WiseJ 1.5 Question and PDF.JS Viewer upgrade to version 5.x

Answered
0
0

We had to upgrade the pdf viewer (pdf.js) in an older application using WiseJ 1.5.58 (yes, we were onboard with WiseJ very early on and converted several VisualWebGui apps back in the early days !!).

 

We were finally able to get it to work with several hurdles, but we had to comment out this line in the webconfig because the new pdf.js dist contains a JSON file it was trying to read from the server:

\<system.webServer>
<modules>
<add name=”Wisej” type=”Wisej.Core.HttpModule, Wisej.Core” />
</modules>
<handlers>
<!–<add name=”json” verb=”*” path=”*.json” type=”System.Web.HttpForbiddenHandler” />–>
<add name=”wisej” verb=”*” path=”*.wx” type=”Wisej.Core.HttpHandler, Wisej.Core” />
</handlers>

 

Will this cause any issues with WiseJ – and why was it a forbidden file anyway ?

 

For anyone else trying to upgrade the PDF.JS viewer – you will need to also add this to your webconfig:

<system.webServer>

<staticContent>
<remove fileExtension=”.mjs” />
<mimeMap fileExtension=”.mjs” mimeType=”application/javascript” />
<mimeMap fileExtension=”.wasm” mimeType=”application/wasm” />
<mimeMap fileExtension=”.ftl” mimeType=”application/octet-stream” />
</staticContent>
</system.webServer>

  • You must to post comments
Best Answer
0
0

Hi Edmond,

by commenting out that line you’re exposing your default.json settings file and any other json files that you might have and that contain sensitive data.

I’d recommend to either add a second web.config inside the pdf folder with the json or allow just that one specific json file in your main web.config.

Best regards
Frank

  • edmond girardi
    hmmm – good point – let me look into that
  • You must to post comments
0
0

Adding a second web.config file in the Pdfjs subfolder works. We put our original webconfig back to the original and removed the static content section from it.

 

This is what the 2nd webconfig file inside the pdfjs subfolder looks like:

 

<?xml version=”1.0″ encoding=”UTF-8″?>
<configuration>
<system.webServer>
<handlers>
<remove name=”json” />
</handlers>
<staticContent>
<remove fileExtension=”.mjs” />
<mimeMap fileExtension=”.mjs” mimeType=”application/javascript” />
<remove fileExtension=”.wasm” />
<mimeMap fileExtension=”.wasm” mimeType=”application/wasm” />
<remove fileExtension=”.ftl” />
<mimeMap fileExtension=”.ftl” mimeType=”application/octet-stream” />
<remove fileExtension=”.json” />
<mimeMap fileExtension=”.json” mimeType=”application/json” />
</staticContent>
</system.webServer>
</configuration>

  • You must to post comments
Showing 2 results
Your Answer

Please first to submit.