noalyss Version-9
Public Member Functions | Data Fields | Private Member Functions
FileToSend Class Reference

file to add to a message More...

+ Collaboration diagram for FileToSend:

Public Member Functions

 __construct ($p_filename, $p_type="")
 
 compute_name ($p_filename)
 Compute properly the filename. More...
 

Data Fields

 $filename
 name of the file without path More...
 
 $full_name
 Path to filename + filename. More...
 
 $path
 path More...
 
 $type
 mimetype of the file More...
 

Private Member Functions

 guess_type ()
 set the $this->type to the mimetype, called from __construct More...
 

Detailed Description

file to add to a message

See also
Sendmail_Core
Author
dany

Definition at line 35 of file filetosend.class.php.

Constructor & Destructor Documentation

◆ __construct()

FileToSend::__construct (   $p_filename,
  $p_type = "" 
)

Definition at line 53 of file filetosend.class.php.

54 {
55 $this->full_name=$p_filename;
56 if (strpos($p_filename,'/') != false)
57 {
58 $this->path=dirname($p_filename);
59 }
60 $this->filename=basename ($p_filename);
61 if ( $p_type=="")
62 {
63 $this->guess_type();
64
65 }
66 }
guess_type()
set the $this->type to the mimetype, called from __construct

References $p_type, and guess_type().

+ Here is the call graph for this function:

Member Function Documentation

◆ compute_name()

FileToSend::compute_name (   $p_filename)

Compute properly the filename.

Todo:
compute a filename

Definition at line 100 of file filetosend.class.php.

101 {
102 /**
103 * @todo compute a filename
104 */
105 }

◆ guess_type()

FileToSend::guess_type ( )
private

set the $this->type to the mimetype, called from __construct

Definition at line 70 of file filetosend.class.php.

71 {
72 $ext_pos= strrpos($this->filename,'.');
73 if ( $ext_pos == false ) {
74 $this->type="application/octect";
75 return;
76 }
77 $ext= substr($this->filename, $ext_pos+1, 3);
78 switch ($ext)
79 {
80 case 'odt':
81 $this->type='application/vnd.oasis.opendocument.text';
82 break;
83 case 'ods':
84 $this->type='application/vnd.oasis.opendocument.spreadsheet';
85 break;
86 case 'pdf':
87 $this->type="application/pdf";
88 break;
89 case 'zip':
90 $this->type="application/zip";
91 break;
92 default:
93 $this->type="application/octet";
94 }
95
96 }
$input_from type
Definition: balance.inc.php:65

References $ext, and type.

Referenced by __construct().

Field Documentation

◆ $filename

FileToSend::$filename

name of the file without path

Definition at line 40 of file filetosend.class.php.

◆ $full_name

FileToSend::$full_name

Path to filename + filename.

Definition at line 52 of file filetosend.class.php.

◆ $path

FileToSend::$path

path

Definition at line 48 of file filetosend.class.php.

◆ $type

FileToSend::$type

mimetype of the file

Definition at line 44 of file filetosend.class.php.


The documentation for this class was generated from the following file: