noalyss
Version-6.7.2
|
file to add to a message More...
Public Member Functions | |
__construct ($p_filename, $p_type="") | |
compute_name ($p_filename) | |
Compute properly the filename. | |
Data Fields | |
$filename | |
name of the file without path | |
$full_name | |
Path to filename + filename. | |
$path | |
path | |
$type | |
mimetype of the file | |
Private Member Functions | |
guess_type () | |
set the $this->type to the mimetype, called from __construct |
FileToSend::__construct | ( | $ | p_filename, |
$ | p_type = "" |
||
) |
Definition at line 44 of file class_filetosend.php.
References guess_type().
{ $this->full_name=$p_filename; if (strpos($p_filename,'/') != false) { $this->path=dirname($p_filename); } $this->filename=basename ($p_filename); if ( $p_type=="") { $this->guess_type(); } }
FileToSend::compute_name | ( | $ | p_filename | ) |
Compute properly the filename.
Definition at line 91 of file class_filetosend.php.
{ /** * @todo compute a filename */ }
FileToSend::guess_type | ( | ) | [private] |
set the $this->type to the mimetype, called from __construct
Definition at line 61 of file class_filetosend.php.
Referenced by __construct().
{ $ext_pos= strrpos($this->filename,'.'); if ( $ext_pos == false ) { $this->type="application/octect"; return; } $ext= substr($this->filename, $ext_pos+1, 3); switch ($ext) { case 'odt': $this->type='application/vnd.oasis.opendocument.text'; break; case 'ods': $this->type='application/vnd.oasis.opendocument.spreadsheet'; break; case 'pdf': $this->type="application/pdf"; break; case 'zip': $this->type="application/zip"; break; default: $this->type="application/octet"; } }
FileToSend::$filename |
name of the file without path
Definition at line 31 of file class_filetosend.php.
FileToSend::$full_name |
Path to filename + filename.
Definition at line 43 of file class_filetosend.php.
FileToSend::$path |
path
Definition at line 39 of file class_filetosend.php.
FileToSend::$type |
mimetype of the file
Definition at line 35 of file class_filetosend.php.