On button click Open file from server in new tab


Confirm 31

I have a button in a modal that should open a sample struct file to submit, which is in my server.

I have tried using:

<button type="button" class="btn btn-info" style="float: left" onclick="window.open('/some/path/to/file/file.pdf')">A FILE</button>

But it keeps returning a 404 Not Found error page.

Does anyone know if there is another way to accomplish this or how to correct this windows.open method?

Balaji

Add ./ before the URL, which will open a new window with the url you provided. ./ means "start from the current directory".

<button class="button" class="btn btn-info" onClick="window.open('./folder/file.pdf');">
    Open
</button>

Related


Open a new tab after button click in AngularJS

Neptune: <button type="button" class="btn btn-primary" ng-click="openTab()">new tab</button> openTab = function () { $http.post('www.google.com'); } What I want is to post a requirement and then open the response html in a new tab when the "openTab" button

Alert on button click and move user to open new tab

Dashan I created a button with a link that opens in a new tab. I also used JavaScript for reminders. Currently this code works fine. But after clicking OK in the Alert, the user stays on the same page. But I want to move the user to the newly opened tab. is it

Protractor button click and open page in new tab

Sumitomo I am new to protractor. I'm trying to automate a scenario where I click a button and it opens a page in a new tab and then we need to populate the form in the new page and submit it. Problem : When I click the button to open a new page. My tests don't

Click Primefaces in a new tab on the button to open the page

username i have this <h:outputLink value="http://.....index.html" target="_blank">open</h:outputLink> But it shows up as a link. How to create a similar button? I need the "Open" button. When I press this button I need to open the link in a new tab in the bro

Protractor button click and open page in new tab

Sumitomo I am new to protractor. I'm trying to automate a scenario where I click a button and it opens a page in a new tab and then we need to populate the form in the new page and submit it. Problem : When I click the button to open a new page. My tests don't

Open a new tab after button click in AngularJS

Neptune: <button type="button" class="btn btn-primary" ng-click="openTab()">new tab</button> openTab = function () { $http.post('www.google.com'); } What I want is to post a requirement and then open the response html in a new tab when the "openTab" button

Open file from new blank tab in Vim

David 542 If I have the following tabs open: :tabe Is it possible to load files in that tab? For example, do the following: :o ~/.vimrc In other words, :tabe ~/.vimrccan I use two commands (one to open a new tab and one to open the file) instead ? Eric Wang B

Open file from new blank tab in Vim

David 542 If I have the following tabs open: :tabe Is it possible to load files in that tab? For example, do the following: :o ~/.vimrc In other words, :tabe ~/.vimrccan I use two commands (one to open a new tab and one to open the file) instead ? Eric Wang B

Click the button to open a new tab

Nathan Wilson I want to create a link with a button that opens in a new tab. The code I'm currently using is currently opening a blank tab and I'm not sure why. <div class="text text-left"> <h2>WORK</h2> <h1>Title</h1> <p>Lorem ipsum dolor sit am

button click: open a new browser tab and call a function

fiber I have a button which calls a function: Perform an AJAX PHP request to the database Display the retrieved data in a div container scroll to div container with bookmark (#) I want a button to do the same task, but with one action, which is to open a new t

Open new tab on button click using JQUERY

Rajan My scene is like this: I have edit user module. Each user is assigned a base INI file . When we edit a user, we have a drop down menu from which to select his base INI file. After selection, we can save the user. And the ID of the selected file is also s

Alert on button click and move user to open new tab

Dashan I created a button with a link that opens in a new tab. I also used JavaScript for reminders. Currently this code works fine. But after clicking OK in the Alert, the user stays on the same page. But I want to move the user to the newly opened tab. is it

Click Primefaces in a new tab on the button to open the page

username i have this <h:outputLink value="http://.....index.html" target="_blank">open</h:outputLink> But it shows up as a link. How to create a similar button? I need the "Open" button. When I press this button I need to open the link in a new tab in the bro

Protractor button click and open page in new tab

Sumitomo I am new to protractor. I'm trying to automate a scenario where I click a button and it opens a page in a new tab and then we need to populate the form in the new page and submit it. Problem : When I click the button to open a new page. My tests don't

Click Primefaces in a new tab on the button to open the page

username i have this <h:outputLink value="http://.....index.html" target="_blank">open</h:outputLink> But it shows up as a link. How to create a similar button? I need the "Open" button. When I press this button I need to open the link in a new tab in the bro

Click Primefaces in a new tab on the button to open the page

username i have this <h:outputLink value="http://.....index.html" target="_blank">open</h:outputLink> But it shows up as a link. How to create a similar button? I need the "Open" button. When I press this button I need to open the link in a new tab in the bro

Click the button to open a new tab

Nathan Wilson I want to create a link with a button that opens in a new tab. The code I'm currently using is currently opening a blank tab and I'm not sure why. <div class="text text-left"> <h2>WORK</h2> <h1>Title</h1> <p>Lorem ipsum dolor sit am

Open new tab on button click using JQUERY

Rajan My scheme is this: I have edit user module. Each user is assigned a base INI file . When we edit a user, we have a drop down menu from which to select his base INI file. After selection, we can save the user. And the ID of the selected file is also saved

Alert on button click and move user to open new tab

Dashan I created a button with a link that opens in a new tab. I also used JavaScript for reminders. Currently this code works fine. But after clicking OK in the Alert, the user stays on the same page. But I want to move the user to the newly opened tab. Is it

Protractor button click and open page in new tab

Sumitomo I am new to protractor. I'm trying to automate a scenario where I click a button and it opens a page in a new tab and then we need to populate the form in the new page and submit it. Problem : When I click the button to open a new page. My tests don't

When button click code needs to open output on new tab

Ammonium chloride I am using apex 18.1 with database 11g in windows and my page has dynamic actions with the following Executre java script; apex.navigation.redirect('localhost:1234/reports/rwservlet? server=servername.&report=myrep.rdf&userid=user/pwd@link&de

Open a new tab after button click in AngularJS

Neptune: <button type="button" class="btn btn-primary" ng-click="openTab()">new tab</button> openTab = function () { $http.post('www.google.com'); } What I want is to post a requirement and then open the response html in a new tab when the "openTab" button

Alert on button click and move user to open new tab

Dashan I created a button with a link that opens in a new tab. I also used JavaScript for reminders. Currently this code works fine. But after clicking OK in the Alert, the user stays on the same page. But I want to move the user to the newly opened tab. is it

Alert on button click and move user to open new tab

Dashan I created a button with a link that opens in a new tab. I also used JavaScript for reminders. Currently this code works fine. But after clicking OK in the Alert, the user stays on the same page. But I want to move the user to the newly opened tab. is it

Protractor button click and open page in new tab

Sumitomo I am new to protractor. I'm trying to automate a scenario where I click a button and it opens a page in a new tab and then we need to populate the form in the new page and submit it. Problem : When I click the button to open a new page. My tests don't

Click Primefaces in a new tab on the button to open the page

username i have this <h:outputLink value="http://.....index.html" target="_blank">open</h:outputLink> But it shows up as a link. How to create a similar button? I need the "Open" button. When I press this button I need to open the link in a new tab in the bro

Click Primefaces in a new tab on the button to open the page

username i have this <h:outputLink value="http://.....index.html" target="_blank">open</h:outputLink> But it shows up as a link. How to create a similar button? I need the "Open" button. When I press this button I need to open the link in a new tab in the bro

button click: open a new browser tab and call a function

fiber I have a button which calls a function: Perform an AJAX PHP request to the database Display the retrieved data in a div container scroll to div container with bookmark (#) I want a button to do the same task, but with one action, which is to open a new t

Open new tab on button click using JQUERY

Rajan My scheme is this: I have edit user module. Each user is assigned a base INI file . When we edit a user, we have a drop down menu from which to select his base INI file. After selection, we can save the user. And the ID of the selected file is also saved