Dynamic generation of text files?

From: Date: Mon, 19 Mar 2001 14:05:36 +0000
Subject: Dynamic generation of text files?
Groups: php.general 
Request: Send a blank email to php-general+get-44545@lists.php.net to get a copy of this message
Hi, I'm trying to get my site to generate text files with a certain extension and MIME-type from a database, "on the fly". Specifically, I would like to build something that can create vCards, that is, text files of a particular format with the extension *.vcf, mime-type text/x-vcard, _at the time that the user clicks the link to download the file_. Currently, the only way I have of doing this is prebuilding all the vcf files when the page is built, then deleting them when the user goes somewhere else -- pretty inefficient. I'd really like to have, e.g. a bunch of links that look like this: <a href="/scripts/GenericCard.vcf?uid=UniqueUserKey">Click here for John Doe's vCard</a> ...so that when the user clicks the link, their contact manager (Outlook, or whatever) fires up on their machine and displays the freshly-generated vCard. I have, of course, thought of modifying the httpd.conf to have apache parse files with a .vcf extension through the php interpreter -- I think that this would be a very bad idea. ;-) So, is this too much to hope for? TIA --Dan

« previous php.general (#44545) next »