Ignore:
Timestamp:
10/20/09 15:24:08 (15 years ago)
Author:
eduardoalex
Message:

Ticket #656 - funcionalidade de arquivamento programado no expressoMail

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/expressoMail1_2/inc/class.exporteml.inc.php

    r1377 r1518  
    318318                        $fileNameReal = $this->remove_accents($attachment['name']); 
    319319                        $ContentType = $this->getFileType($fileNameReal); 
    320                         $fileName = $fileNameReal . ".php"; 
     320                        $fileName = $fileNameReal; 
     321                        if(strpos($ContentType,"text")!==false || 
     322                                        strpos($ContentType,"image")!==false || 
     323                                        strpos($ContentType,"audio")!==false) 
     324                                $fileName.= ".php"; 
    321325                        $f = fopen($tempDir . '/'.$tempSubDir.'/'.$fileName,"wb"); 
    322326                        if(!$f) 
     
    326330                        $urlPath = 'tmpLclAtt/'.$tempSubDir.'/'.$fileName; 
    327331                         
    328                         $headers = "<?php header('Content-Type: ".$ContentType."'); 
    329                                 header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); 
    330                                 header('Pragma: public'); 
    331                                 header('Expires: 0'); // set expiration time 
    332                                 header('Content-Disposition: attachment; filename=\"". addslashes($fileNameReal) ."\"');\n echo "; 
    333                          
    334                         if($attachment['encoding'] == 'base64') { 
    335                                 $headers.=" imap_base64('".$fileContent."');?>"; 
    336                         } 
    337                         else if($attachment['encoding'] == 'quoted_printable_decode') { 
    338                                 $headers.=" quoted_printable_decode('".$fileContent."');?>"; 
     332                        if(strpos($ContentType,"text")!==false || 
     333                                        strpos($ContentType,"image")!==false || 
     334                                        strpos($ContentType,"audio")!==false) { 
     335                                $headers = "<?php header('Content-Type: ".$ContentType."'); 
     336                                        header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); 
     337                                        header('Pragma: public'); 
     338                                        header('Expires: 0'); // set expiration time 
     339                                        header('Content-Disposition: attachment; filename=\"". addslashes($fileNameReal) ."\"');\n echo "; 
     340                         
     341                                if($attachment['encoding'] == 'base64') { 
     342                                        $headers.="imap_base64('".$fileContent."');?>"; 
     343                                } 
     344                                else if($attachment['encoding'] == 'quoted_printable_decode') { 
     345                                        $headers.="quoted_printable_decode('".$fileContent."');?>"; 
     346                                } 
     347                                else { 
     348                                        $headers.="'".$fileContent."';?>"; 
     349                                } 
    339350                        } 
    340351                        else { 
    341                                 $headers.=" '".$fileContent."';?>"; 
     352                                if($attachment['encoding'] == 'base64') { 
     353                                        $headers=imap_base64($fileContent); 
     354                                } 
     355                                else if($attachment['encoding'] == 'quoted_printable_decode') { 
     356                                        $headers=quoted_printable_decode($fileContent); 
     357                                } 
     358                                else { 
     359                                        $headers=$fileContent; 
     360                                } 
    342361                        } 
    343362                         
     
    366385                if ($strFileType == ".gif") 
    367386                        $ContentType = "image/gif"; 
     387                if ($strFileType == ".png") 
     388                        $ContentType = "image/png"; 
    368389                if ($strFileType == ".jpg" || $strFileType == "jpeg") 
    369390                        $ContentType = "image/jpeg"; 
Note: See TracChangeset for help on using the changeset viewer.