Skip to content Skip to sidebar Skip to footer

File Is Not Being Downloaded When Requested Through Ajax Using Jquery

I need to download a .CSV file with certain information from a website, so I'm using a link and some Javascript/JQuery to get the table from the servr and create the file. I have t

Solution 1:

I would recommend you create the CSV at server side PHP program and set Content-Type as "application/vnd.ms-excel" (or) "text/csv" and set "Content-Disposition: attachment; [yourfilename] "

Refer this Create a CSV File for a user in PHP

Refer this Force Download CSV File

Simply put hyperlink as

<aclass="areaSummaryExport"href="admin_ajax.php"value="1">...</a>

Post a Comment for "File Is Not Being Downloaded When Requested Through Ajax Using Jquery"