dsaba Posted January 12, 2008 Share Posted January 12, 2008 Hi I'm not too familiar with algorithms for serving files or do not really know how much control php has over how a server can serve a file to the user. Here is my problem: I have a file that has 3 parts sitting on my server. I would like to enable somehow for a user to click only 1 link or be able to download these 3 parts of the file as one file. So when the user looks at the downloaded file on his computer it will be only 1 file. 1. So is it possible with PHP to combine files on a server and stream it out to the user as 1 file so he can download it? 2. My second question is if this is possible, is there a way to serve 3 500KB files as 1 file, but never store more than 500KB of data on the server. Thanks for looking. Quote Link to comment Share on other sites More sharing options...
BenInBlack Posted January 12, 2008 Share Posted January 12, 2008 here is psudo code for you to get the concept ob_start() $a = file_get_contents(path to a) $b = file_get_contents(path to b) $c = $a.$b ob_clean() header(content-type); echo $c Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.