Command exec opens the file in Internet explorer instead of opening the command in a new Chrome tab

Asked

Viewed 16 times

-1

Is there any way to make exec() open a pdf file in a browser other than the one set by default without having to modify the latter?

My goal is to get exec to specifically open the pdf in a new Chrome tab instead of opening a new window in the default browser.

(It does not necessarily have to be in Chrome but in the browser where the user is using the application)

1 answer

1

I think that with php there is no way, because it is on the server and would not know which browser the client is using. Maybe using javascript. Follow an example of the code to see if it helps you: window.open('/arquivo/teste.pdf');

Browser other questions tagged

You are not signed in. Login or sign up in order to post.