Using onclick=window.open function in js to open a pdf file link in a new popup window.
Works fine to display the file onscreen, but not if the user wants to save the file client-side to their computer.
The right-hand-button context menu for the mouse will allow the user to download, but the file saved will be a html dump file for the webpage
and the name of the file will be that for the webpage.
Of course I can use the easy <a href> method for download links and the mouse context menu options will be as expected,
but I can only use target="-blank" or target="_self".
I need a popup window to open.
Could use :
oncontextmenu="alert('Left click the link to open, and then SAVE from with the pdf viewer')
to advise users how to save the file, and could use
"javascript: void(0)"
to eliminate most mouse context menu options, so the user won't bother try.
So how can I get a link to a file which can be viewed in a popup window and downloaded using mouse right-hand context menu?
Any advice massively appreciated!
Works fine to display the file onscreen, but not if the user wants to save the file client-side to their computer.

The right-hand-button context menu for the mouse will allow the user to download, but the file saved will be a html dump file for the webpage
and the name of the file will be that for the webpage.
Of course I can use the easy <a href> method for download links and the mouse context menu options will be as expected,
but I can only use target="-blank" or target="_self".
I need a popup window to open.
Could use :
oncontextmenu="alert('Left click the link to open, and then SAVE from with the pdf viewer')
to advise users how to save the file, and could use
"javascript: void(0)"
to eliminate most mouse context menu options, so the user won't bother try.
So how can I get a link to a file which can be viewed in a popup window and downloaded using mouse right-hand context menu?
Any advice massively appreciated!
Comment