simply using jQuery and ajax: JFYI: input size limit is a server setting, it doesn't matter you're using ajax or form with input html:
$<form id="downloaderForm" action="downloadCsv.ajax({ php" method="post"> <intput type="hidden" name="json" url:id="jsonData" "/path/to> </php_script.php",form> JQuery
$("#jsonData").val(yourData); $("#downloaderForm").submit(); or JS
document.getElementById("jsonData").value = yourData; document.getElementById("downloaderForm").submit(); PHP
header("Content-type: "POST",text/csv"); dataheader("Content-Disposition: "jsonData=" +attachment; stringifiedArray,filename=json-cconverted-to-csv.csv"); successheader("Pragma: function(responseno-cache") {; if header(response ==="Expires: "some-value"0") {; echo $csvData; // redirect the user to dowload the file } } Your CSV });Data