RE: [Mail_Imap] Attachments downloadable yet?

From: Date: Tue, 25 May 2004 05:29:10 +0000
Subject: RE: [Mail_Imap] Attachments downloadable yet?
Groups: php.pear.general 
Request: Send a blank email to pear-general+get-12715@lists.php.net to get a copy of this message
Just a short question regarding Mail_Imap: Is there any easy way to download
the attachments instead of displaying them in HTML?
Sorry for the belated reply. If I understand your question correctly, if you want to force download of an attachment use header() to initiate the necessary changes. For instance, in place of the IMAP.message.php example file in the package, you could replace the code in that file with something like this: <?php // snip connection stuff here $body = $msg->getBody($_GET['mid'], $_GET['pid']); header('Content-Type: '.$body['ftype']); header('Content-Disposition: attachment; filename='.$body['fname']); echo $body['message']; ?> This will present the user with a "save as" dialouge. HTH! Regards, Richard York -- ::::::::::::::::::::::::::::::::::::::::: The Spicy Peanut Project http://www.spicypeanut.net :::::::::::::::::::::::::::::::::::::::::

« previous php.pear.general (#12715) next »