You are here: Re: File Download dialog problem « All PHP « IT news, forums, messages
Re: File Download dialog problem

Posted by robert on 09/28/89 11:48

| > <?php
| > include 'config.php';
| > include 'opendb.php';
| >
| > $query="select * from atable";
| > $result = mysql_query($query) or die(mysql_error());
| >
| > $csv = array();
| > $html = array();
| > while($row = mysql_fetch_array($result, MYSQL_NUM))
| > {
| > $csv[] = implode(",", $row);
| > $html[] = "<tr><td>" .implode("</td><td>", $row) . "</td></tr>";
| > }
| >
| >
| > $tsv = implode("\r\n", $csv);
| > $html = "<table>" . implode("\r\n", $html) . "</table>";
| >
| > $fileName = 'DBDownload.csv';
| > //header("Content-type: text/plain");
| > header("Content-type: application/x-msdownload");
| > header("Content-Disposition: attachment; filename=$fileName");
| > print $tsv;
| > exit;
| > ?>


try content-type: application/force-download, or content-type:
application/octet-stream...not the x-msdownload crap. ;^)

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация