html - How to open an excel file in a browser on anchor button click in php

224

I am new toPHP development. I have an anchor button in myPHP view. Right now I am downloading the excel file on the anchor button click. But now I want to open it in a browser and then print it from there. For this I have searched many articles and found this solution but it doesn't tell how to call it.

For now I am doing the following

<a href="/inventory-web/Files/Example.xlsx" open class="btn btn-info" target="_blank" >Download File</a>

Hereopen is use to open the excel file. When I click on the button it does open a new browser but it gives the error.

enter image description here

Any help would be highly appreciated.

People are also looking for solutions to the problem: xml - Variable seems to keep it's initial value in if statement - PHP, SimpleXML

Source

Didn't find the answer?

Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.

Ask a Question

Write quick answer

Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.

Similar questions

Find the answer in similar questions on our website.