...

View Full Version : Multi-part HTTP



Lamped
03-27-2009, 07:02 PM
So I was wondering. You can have a multipart MIME email with html and embedded images. Can you have a multipart MIME webpage, where instead of the browser making additional requests for the images and such, the browser pushes it along with the html...

I don't even know if this is remotely possible. I ended up accidentally doing the old server push thing, where only the last mime segment is displayed.

Here's the current state of the code I was playing with:


<?php
header('Content-Type: multipart/related; boundary="httpmimetest"');
header('MIME-Version: 1.0');

$data = '<html><body>Multipart HTTP Test<img src="cid:blahpoo" /></body></html>';
$image = 'images/header_bg.jpg';
$image_data = base64_encode(file_get_contents($image));
echo('--httpmimetest'."\n");
echo('Content-Type: text/html'."\n");
echo('Content-Length: '.strlen($data)."\n");
echo("\n");
echo($data."\n");
echo('--httpmimetest'."\n");
echo('Content-Location: CID:unimportant'."\n");
echo('Content-ID: <blahpoo>'."\n");
echo('Content-Type: image/jpeg'."\n");
echo('Content-Transfer-Encoding: base64'."\n");
echo('Content-Length: '.strlen($image_data)."\n");
echo("\n");
echo($image_data);
echo("\n".'--httpmimetest--'."\n");
?>



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum