topical media & game development

talk show tell print

professional-ajax-09-AjaxMail-AjaxMailAttachment.php / php



  <?php
      require_once("inc/config.inc.php");
      require_once("inc/pop3lib/pop3.class.php");
      require_once("inc/pop3lib/pop3message.class.php");
      require_once("inc/pop3lib/pop3header.class.php");
      require_once("inc/pop3lib/pop3attachment.class.php");
      require_once("inc/AjaxMail.inc.php");
      
      //get information
      id = _GET["id"];
  
      //create new mailbox
      mailbox = new AjaxMailbox();
      
      //get the attachment
      attachment = mailbox->getAttachment(id);
  
      //headers
      header("Content-Type: attachment->contentType");
            header("Content-Disposition: attachment; filename=attachment->filename"); 
  
      //output the body
      echo attachment->data;   
  ?>


(C) Æliens 20/2/2008

You may not copy or print any of this material without explicit permission of the author or the publisher. In case of other copyright issues, contact the author.