topical media & game development

talk show tell print

professional-ajax-09-AjaxMail-inc-pop3lib-pop3attachment.class.php / php



  <?php
  
  class Pop3Attachment {
          var contentType;
          var fileName;
          var data;
  
          function Pop3Attachment(attachment) {
                  foreach (attachment as atc) {
                          ctparts = split(";",atc["content-type"]);
                          if (count(ctparts) > 1) {
                                  this->contentType = trim(ctparts[0]);
                          }
                          foreach (ctparts as ctpart) {
                                  if (strstr(ctpart,"name=")) {
                                          filename = split("=",ctpart);
                                          this->fileName = str_replace("\"","",filename[1]);
                                  }
                          }
                  }
                  
                  this->data = trim(attachment['content']);
          }
  }
  
    
  ?>


(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.