Changeset 1518 for trunk/expressoMail1_2/inc/class.exporteml.inc.php
- Timestamp:
- 10/20/09 15:24:08 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/expressoMail1_2/inc/class.exporteml.inc.php
r1377 r1518 318 318 $fileNameReal = $this->remove_accents($attachment['name']); 319 319 $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"; 321 325 $f = fopen($tempDir . '/'.$tempSubDir.'/'.$fileName,"wb"); 322 326 if(!$f) … … 326 330 $urlPath = 'tmpLclAtt/'.$tempSubDir.'/'.$fileName; 327 331 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 } 339 350 } 340 351 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 } 342 361 } 343 362 … … 366 385 if ($strFileType == ".gif") 367 386 $ContentType = "image/gif"; 387 if ($strFileType == ".png") 388 $ContentType = "image/png"; 368 389 if ($strFileType == ".jpg" || $strFileType == "jpeg") 369 390 $ContentType = "image/jpeg";
Note: See TracChangeset
for help on using the changeset viewer.