bullet89 bullet89 - 19 days ago 5
PHP Question

download .xls file in php(cpanel) using href

I had .xls file in report folder

<a href="http://website.com/report/salesList.xls" download>
<input type="button" class="btn btn-success" value="Download Report">
</a>


was not working.

Instead:

<a href="http://website.com/images/123.png" download>
<input type="button" class="btn btn-success" value="Download Image">
</a>


was working.

Need to give any permission for .xls format files?

Thanks.

Answer

change the permission of .xls file, by chmod($file,0644) in php file where you are auto generating the excel file.