# Sending CSV file

**URL:** <https://forum.kirupa.com/t/sending-csv-file/280946>\
**Category:** programming\
**Created:** [February 3, 2009, 8:34am UTC](https://forum.kirupa.com/t/sending-csv-file/280946 "2009-02-03T08:34:53Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![stedem](https://avatars.discourse-cdn.com/v4/letter/s/7c8e57/32.png) [@stedem](https://forum.kirupa.com/u/stedem)\
**Post date:** [February 3, 2009, 8:34am UTC](https://forum.kirupa.com/t/sending-csv-file/280946/1 "2009-02-03T08:34:53Z")

</div>

Hi,

I have a working php page that hides a real location of a pdf file and then sends it to the visitor. Now i want to do this with a xls or csv file

```php

header('Content-type: application/pdf');
header('Content-Disposition: attachment; filename="document.pdf"');
readfile('real_file_location/file.pdf');

```

I tried this with all kinds of tricks i found on the net but didn’t find a working solution

```php

header('Content-type: application/vnd.ms-excel');
header('Content-Disposition: attachment; filename="document.xls"');
readfile('real_file_location/file.xls');

```
