Issue with opening a pdf, on click of link button in button widget

0
Hello I am working on a page which is supposed to have a link, on click of which PDF document should open on the screen or as pop-up but not download. For this, I am using a link button, with link type as “web” and “Address attribute” (since I am storing the path in an attribute)  Since the PDF that I want to display on mendix screen is saved in my local,  the path that I am storing in my attribute is “file:/D:/Testing/LocalTesting/Test.PDF”(also tried giving D:\Testing\LocalTesting\Test.PDF ) Testing: I clicked the link expected: Test.pdf should open Actual: I am getting below error Access to 'file:///D:/Testing/LocalTesting/Test.pdf' from script denied m/</<@http://localhost:8080/mxclientsystem/mxui/mxui.js?636989709858735608:46:156477 s/</<@http://localhost:8080/mxclientsystem/mxui/mxui.js?636989709858735608:20:2051 s/<@http://localhost:8080/mxclientsystem/mxui/mxui.js?636989709858735608:20:1369 a@http://localhost:8080/mxclientsystem/mxui/mxui.js?636989709858735608:20:927 a@http://localhost:8080/mxclientsystem/mxui/mxui.js?636989709858735608:52:221324 M/<@http://localhost:8080/mxclientsystem/mxui/mxui.js?636989709858735608:52:221469 c@http://localhost:8080/mxclientsystem/mxui/mxui.js?636989709858735608:52:224440 From the error , it seems that I am not able to reach the path to pick the file…….Can someone please guide me…...
asked
3 answers
1

Fot that functionality is use this widget: https://appstore.home.mendix.com/link/app/12/ 

It can show the pdf inline or in a pop-up.

answered
0

Keep that file in your mendix project directory and try again.

answered
0

Dear Anasa,

Browsers can not access local files from disk, for good security reasons. You can only link to web URLS.

If you want users to access PDFs, make sure they are store in a System.FileDocument and use de Download activity of a microflow (https://docs.mendix.com/refguide/download-file) or the download button for the File Manager https://docs.mendix.com/refguide/file-manager

Alternative you can use a widget from the app store to display the PDF in your application

Cheers, Andries

answered