ChrisChuah 0 Posted March 6, 2021 (edited) Hi In Delphi 10.4.1, when the Win64 program called WebBrowser1.Navigate("file://z:\filename.pdf") where z drive is a shared drive, it will display the pdf in the Browser. However, when i upgraded to 10.4.2, the same function will prompt for File Download. I also tested to navigate a C drive pdf document and it will also prompt the file download Please help ====== source ========= procedure TForm1.Button1Click(Sender: TObject); var l_filename : string; begin if OpenDialog1.Execute then begin l_filename := OpenDialog1.FileName; // l_filename := 'file://' + l_filename; WebBrowser1.Navigate(l_filename); end; end; ======= End ================ regards chris Edited March 6, 2021 by ChrisChuah Share this post Link to post
Guest Posted March 6, 2021 6 hours ago, ChrisChuah said: However, when i upgraded to 10.4.2, the same function will prompt for File Download. look in your Edge Browser, or, current browser by default, the options about "download" some file-type, like pdf. some files, is not allow to be showed, but, to be downloaded by default. hug Share this post Link to post
ChrisChuah 0 Posted March 7, 2021 hi Previously it was chrome as a default but i set to Edge Browser. However, i could not find anything about download on file type in Edge Browser. something related to mime type? regards chris Share this post Link to post
Guest Posted March 8, 2021 email45x is trying to point out that this is a browser setting. If you cannot identify how to change that setting over the command line then you will need to find another approach. If this is software only you will be using (a tool or some such) change settings in your browser, not in your program. If it is production software you will need to add some kind of instruction of browser-selection and setup. IMHO a browser is not the best way of showing PDF:s, browsers change the implementation often. Also PDFs are a sizeable attack vector (scripted files). Share this post Link to post
Der schöne Günther 316 Posted March 8, 2021 (edited) The "Navigation to web page was cancelled" indicates that this rendered by Internet Explorer. You either had an internet explorer plug-in for rendering PDFs (like Adobe Reader), or you had your TWebBrowser set to use Edge instead of Internet Explorer. Edge displays PDFs flawlessly with no external dependencies. Edited March 8, 2021 by Der schöne Günther Share this post Link to post
Guest Posted March 8, 2021 On 3/6/2021 at 5:41 AM, ChrisChuah said: I also tested to navigate a C drive pdf document and it will also prompt the file download look if help in some: hug Share this post Link to post
ChrisChuah 0 Posted May 13, 2021 Hi So sorry for the late reply actually, its the problem with Adobe Acrobat with Internet Explorer. I have to uninstall and re-install Adobe Acrobat again. seems like that solve my problem. regards chris Share this post Link to post