Reply to Re: Save dynamic data to text file

Your name:

Reply:


Posted by Michael S Bykov on 11/12/07 14:52

On Nov 12, 11:37 am, WayneBurrows <wjburr...@gmail.com> wrote:
> Can I save dynamically created data to a text file on the client's
> machine?
>
> Preferrably in a user named file through a save dialog box.
>
> Thanks
>
> Wayne

<?php
$string = "bla bla bla"; // file content
$filename='some.txt';
$mime_type = (PMA_USR_BROWSER_AGENT == 'IE' ||
PMA_USR_BROWSER_AGENT == 'OPERA')
? 'application/octetstream'
: 'application/octet-stream';
header('Content-Type: ' . $mime_type);
if (PMA_USR_BROWSER_AGENT == 'IE')
{
header('Content-Disposition: inline; filename="' . $filename .
'"');
header("Content-Transfer-Encoding: binary");
header('Expires: 0');
header('Cache-Control: must-revalidate, post-check=0, pre-
check=0');
header('Pragma: public');
print $string;
} else {
header('Content-Disposition: attachment; filename="' .
$filename . '.' . $ext . '"');
header("Content-Transfer-Encoding: binary");
header('Expires: 0');
header('Pragma: no-cache');
print $string;
};

?>

if you'll need any explanations - tell me.

[Back to original 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

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