Package with file loading from database.

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
njwan
Forum Newbie
Posts: 8
Joined: Wed Jul 28, 2004 1:52 am

Package with file loading from database.

Post by njwan »

I would like to package some files to download this, but all files are content in Database, How can I get it to package?
Ex:
I save file name: test.doc, test.xsl in mysql Database by DataBloc
And now I want to get all files and package to package1.tar (content test.doc and test.xsl) to download it.

How can I package? Help me please.
Thanks!
Bennettman
Forum Contributor
Posts: 130
Joined: Sat Jun 15, 2002 3:58 pm

Post by Bennettman »

header() has a lot of content on doing this.

The basic idea is that you set headers to tell the browser the type of file it is, and then load the package content in from the database.
njwan
Forum Newbie
Posts: 8
Joined: Wed Jul 28, 2004 1:52 am

Package with file loading from database.

Post by njwan »

I would like to package some files to download this, but all files are content in Database, How can I get it to package?
Ex:
I save file name: test.doc, test.xsl in mysql Database by DataBloc
And now I want to get all files and package to package1.tar (content test.doc and test.xsl) to download it.

How can I package? Help me please.
Thanks!

The Header() is support to download, I want add to package before download!
User avatar
n00b Saibot
DevNet Resident
Posts: 1452
Joined: Fri Dec 24, 2004 2:59 am
Location: Lucknow, UP, India
Contact:

Post by n00b Saibot »

If you want to genetrate them on the fly then first read the files from database and write them to files with same names. Then use exec to tar them into a package an dthen send this on its way. pretty simple.;)
Post Reply