Hi buddies.
I have issue to send file. Here is my code:
$fp = fopen('php://output', 'w');
if ($fp && $rowT)
{
header('Content-Type: text/csv');
header('Content-Disposition: attachment; filename="export.csv"');
header('Pragma: no-cache');
header('Expires: 0');
fputcsv($fp, $headers);
while ($row = mysqli_fetch_array($rowT))
{
fputcsv($fp, $row["id"]);
}
}
$datat= array('chat_id' => $chat_id,'document'=> $fp);
sendDocument($datat);
how can I send created file?
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Hi buddies. I have issue to send file. Here is my code: $fp = fopen('php://output', 'w'); if ($fp && $rowT) { header('Content-Type: text/csv'); header('Content-Disposition: attachment; filename="export.csv"'); header('Pragma: no-cache');
header('Expires: 0'); fputcsv($fp, $headers); while ($row = mysqli_fetch_array($rowT)) { fputcsv($fp, $row["id"]); }
} $datat= array('chat_id' => $chat_id,'document'=> $fp); sendDocument($datat); how can I send created file?