I created a script to export member's items into a tab-delimited txt file. The script works great, it escapes tabs and new lines and creates a perfect export.txt file.
Problem: I have another link so people can download the export.txt file onto their computers using:
$file = "export-files/".$member.".txt";
header('Content-Description: File Transfer');
header('Content-Disposition: attachment; filename='.basename($file));
header('Content-Length: ' . filesize($file));
When I download export.txt, it appears to have newly created line-breaks that are not found in the export.txt file on the server. Does anyone know why this happens and how to prevent this?