Answer the question
In order to leave comments, you need to log in
Feature of working with HTTPS in IE8 and below?
Hello
, I've run into a problem.
There is a script that generates a report in CSV format (but that's not the point), and then gives the user a download. To be more precise, the script immediately starts dumping data for output even while reading from the database, without saving it in memory, since the report can take many megabytes.
Headers that are set at the beginning of the script:
Content-type: text/csv; charset=utf8; header=present<br>
Content-disposition: attachment; filename=report.csv<br>
$res = $db->query($sql);<br>
while ($data = $res->fetchRow())<br>
echo $data;<br>
Answer the question
In order to leave comments, you need to log in
Microsoft is aware of this issue. Offers to edit the registry on the user's computer: support.microsoft.com/kb/323308
And why not do it in 2 passes - first we count the length of the data, then we give the finished CSV? It will be slower, but the memory will not end.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question