problem with downloading csv file
Posted: Sun Jan 07, 2007 1:07 am
feyd | Please use
Thank U
Murali
feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
Hello,
I have a problem with downloading csv file, before down loading i am writing it and saving it into one folder after that i am downloading it by it's name. But i am getting the data after one row of csv file, ie, the first line is kept empty.
My Script will be:Code: Select all
$fp1 = fopen(DIR_FS_DOCUMENT_ROOT.'import/' . $file_name,"rb");
$buffer = fread($fp1, filesize(DIR_FS_DOCUMENT_ROOT.'import/' . $file_name));
fclose($fp1);
header('Content-type: application/csv');
header("Content-disposition: attachment; filename=\"$file_name\"");
echo $buffer;
ob_end_flush();
exit;Murali
feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]