Just wondering if there is a way to open the csv file in the browser instead of being downloaded?
My code:
<a href="Myfile.csv">Open</a>
In most browsers, clicking on the link will open the file directly in the browser. But, if you add the download attribute to the link, it will tell the browser to download the file instead. The download attribute works in all modern browsers, including MS Edge, but not Internet Explorer.
You have to add the following header.
header ('Content-Type: text/csv');
header ('Content-Type: text/csv');
OR
Set iframe and put your CSV file URL in it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With