Page 1 of 1

On the fly file generation

Posted: Wed Jan 15, 2003 10:57 pm
by press711
Can any one direct me to any articles of information on creating temporary files on the fly.
I tried searching for it but did'nt get much.
I need to allow my customers to click on a button and the script should create a file, which is attached and send to the users database. The file is a iif file for quickbooks. I dont want to store the file just send it as a attachment.

Thanks,
Kunal :)

Posted: Wed Jan 15, 2003 11:02 pm
by volka
do you want to send it as mail-attachment or do you want the client's browser to show the "save as"-dialog or what is that "users database"?

Posted: Wed Jan 15, 2003 11:59 pm
by press711
volka wrote:do you want to send it as mail-attachment or do you want the client's browser to show the "save as"-dialog or what is that "users database"?
I want it as a mail attachment.
The file to be geerated is a simple tab delimited text file.

Cheers,
Kunal

Posted: Thu Jan 16, 2003 1:28 am
by volka
php's own mail-function is like the old cli mail command. It's knows nothing about attachments, html-mail and so on. But nevertheless it is possible to use those features as they were set on top of the old protocol.
The online manual for mail() links to two other pages.
The first describes how mime-mails (with or without attachments) are structured and how you may create them with mail().
The second takes you to PEAR's Mail_Mime packages.
There are a lot more packages/classes that simplify mime-mails, e.g. at phpguru.org

Thats done

Posted: Thu Jan 16, 2003 4:48 am
by press711
I got a multipart MIME sending class ( http://www.phpguru.org/ ) which helped me send mail by simply calling a function for adding a attachment.

Thnks for your time and help.

Cheers,
Kunal :)