On the fly file generation

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
press711
Forum Newbie
Posts: 5
Joined: Wed Jan 15, 2003 1:50 am

On the fly file generation

Post 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 :)
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post 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"?
User avatar
press711
Forum Newbie
Posts: 5
Joined: Wed Jan 15, 2003 1:50 am

Post 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
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post 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
User avatar
press711
Forum Newbie
Posts: 5
Joined: Wed Jan 15, 2003 1:50 am

Thats done

Post 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 :)
Post Reply