Exponential Basic 2.4.0.1 Exponential Basic CMS — PHP Class Reference

Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
eZPBFile Class Reference
Inheritance diagram for eZPBFile:

## Public Member Functions
| __construct ()
| getUploadedFile ( $name_var)
| dumpDataToFile ( $data, $fileName)
| dumpFroogleDataToFile ( $data, $fileName)
| dumpYahooDataToFile ( $data, $fileName)
| getFile ( $fileName)
| move ( $dest)
| copy ( $dest)
| name ()
| type ()
| size ()
| tmpName ()
| setType ( $type)

## Static Public Member Functions
static & | siFileSize ( $size)
static | file_exists ( $filename)
static | is_file ( $filename)
static | filemtime ( $filename)
static | fopen ( $filename, $options)
static | filesize ( $filename)
static | unlink ( $filename)
static | chmod ( $filename, $mode)
static | dir ( $dir, $add_sitedir=true)
static | is_dir ( $dir)
static | realpath ( $filename)
static | file ( $filename)

## Public Attributes
| $FileName
| $TmpFileName
| $FileType
| $FileSize

## Detailed Description

! eZCommon The eZPBFile class handles fileuploads, and other file functions.

Example:

$file = new eZPBFile();
if ( $file->getFile( "userfile" ) )
{
print( $file->name() . " uploaded successfully" );
}
else
{
print( $file->name() . " not uploaded successfully" );
}
eZPBFile
Definition: ezpbfile.php:49
$file
$file
Definition: ezfilemanager/user/filedownload.php:35

Definition at line 48 of file ezpbfile.php.

## Constructor & Destructor Documentation

## ◆ __construct()

eZPBFile::__construct | ( |  | ) |

Constructs a new eZPBFile object

Reimplemented in eZPBImageFile.

Definition at line 53 of file ezpbfile.php.

## Member Function Documentation

## ◆ chmod()

static eZPBFile::chmod | ( |  | $filename,
|  |  | $mode
| ) |  |
| static

Same as chmod(), but prepends $siteDir if $dest not empty.

Definition at line 371 of file ezpbfile.php.

References $GlobalSiteIni.

Referenced by eZPBImageFile\convertCopy(), copy(), eZImage\createWatermark(), and eZPBImageFile\scaleCopy().

## ◆ copy()

eZPBFile::copy | ( |  | $dest | ) |

Copies the uploaded file to the desired directory.

Returns true if successful.

Definition at line 166 of file ezpbfile.php.

References $GlobalSiteIni, $ret, and chmod().

Referenced by eZPBImageFile\scaleCopy().

## ◆ dir()

static eZPBFile::dir | ( |  | $dir,
|  |  | $add_sitedir = `true`
| ) |  |
| static

Same as dir(), but prepends $siteDir if $dir not empty.

Definition at line 384 of file ezpbfile.php.

References $dir, $GlobalSiteIni, and $ret.

Referenced by syncDir(), and unlinkWild().

## ◆ dumpDataToFile()

eZPBFile::dumpDataToFile | ( |  | $data,
|  |  | $fileName
| ) |  |

Dumps the data to a temporary file. Sets the variables in this file.

Definition at line 89 of file ezpbfile.php.

References $fh, $fileName, $ini, and fopen().

## ◆ dumpFroogleDataToFile()

eZPBFile::dumpFroogleDataToFile | ( |  | $data,
|  |  | $fileName
| ) |  |

Dumps the data to a temporary file. Sets the variables in this file.

Definition at line 105 of file ezpbfile.php.

References $fh, $fileName, $ini, and fopen().

## ◆ dumpYahooDataToFile()

eZPBFile::dumpYahooDataToFile | ( |  | $data,
|  |  | $fileName
| ) |  |

Dumps the data to a temporary file. Sets the variables in this file.

Definition at line 120 of file ezpbfile.php.

References $fh, $fileName, $ini, and fopen().

## ◆ file()

static eZPBFile::file | ( |  | $filename | ) |
| static

Same as file(), but prepends $siteDir if $filename not empty.

Definition at line 428 of file ezpbfile.php.

References $siteDir, and file_exists().

## ◆ file_exists()

static eZPBFile::file_exists | ( |  | $filename | ) |
| static

Same as file_exists(), but prepends $siteDir if $filename not empty.

Definition at line 267 of file ezpbfile.php.

References $GlobalSiteIni.

Referenced by file(), filemtime(), eZPBImageFile\scaleCopy(), and unlink().

## ◆ filemtime()

static eZPBFile::filemtime | ( |  | $filename | ) |
| static

Same as filemtime(), but prepends $siteDir if $filename not empty.

Definition at line 306 of file ezpbfile.php.

References $GlobalSiteIni, and file_exists().

Referenced by eZPBINIFile\__construct(), eZMenuBox\createBox(), and eZTemplate\hasCache().

## ◆ filesize()

static eZPBFile::filesize | ( |  | $filename | ) |
| static

Same as filesize(), but prepends $siteDir if $filename not empty.

Definition at line 339 of file ezpbfile.php.

References $GlobalSiteIni.

Referenced by eZGPG\__construct(), eZTemplate\cache(), eZVirtualFile\fileSize(), getFile(), parse(), and eZMail\send().

## ◆ fopen()

static eZPBFile::fopen | ( |  | $filename,
|  |  | $options
| ) |  |
| static

Same as fopen(), but prepends $siteDir if $filename not empty.

Definition at line 326 of file ezpbfile.php.

References $GlobalSiteIni, and $options.

Referenced by eZPBLog\__construct(), eZPBINIFile\__construct(), eZGPG\__construct(), eZTemplate\cache(), createPollMenu(), createSmallArticleList(), dumpDataToFile(), dumpFroogleDataToFile(), dumpYahooDataToFile(), parse(), save_data(), eZMail\send(), and eZTemplate\storeCache().

## ◆ getFile()

eZPBFile::getFile | ( |  | $fileName | ) |

Definition at line 136 of file ezpbfile.php.

References $fileName, $ret, and filesize().

## ◆ getUploadedFile()

eZPBFile::getUploadedFile | ( |  | $name_var | ) |

Fetches the uploaded file information.

The $name_var variable is refering to the html <input .. variable>

See the example for more details.

Definition at line 66 of file ezpbfile.php.

References $ret.

## ◆ is_dir()

static eZPBFile::is_dir | ( |  | $dir | ) |
| static

Same as is_dir(), but prepends $siteDir if $dir not empty.

Definition at line 402 of file ezpbfile.php.

References $dir, and $GlobalSiteIni.

Referenced by Template\set_root().

## ◆ is_file()

static eZPBFile::is_file | ( |  | $filename | ) |
| static

Same as is_file(), but prepends $siteDir if $filename not empty.

Definition at line 287 of file ezpbfile.php.

References $GlobalSiteIni.

Referenced by eZMedia\filePath(), and eZPBImageFile\scaleCopy().

## ◆ move()

eZPBFile::move | ( |  | $dest | ) |

Moves the uploaded file to the desired directory.

Returns true if successful.

Definition at line 156 of file ezpbfile.php.

## ◆ name()

eZPBFile::name | ( |  | ) |

Returns the original file name.

Definition at line 189 of file ezpbfile.php.

References $FileName.

## ◆ realpath()

static eZPBFile::realpath | ( |  | $filename | ) |
| static

Same as realpath(), but prepends $siteDir if $filename not empty.

Definition at line 415 of file ezpbfile.php.

References $GlobalSiteIni.

Referenced by eZPBINIFile\__construct().

## ◆ setType()

eZPBFile::setType | ( |  | $type | ) |

Sets the mime type of the file.

Definition at line 259 of file ezpbfile.php.

References $type.

## ◆ siFileSize()

static& eZPBFile::siFileSize | ( |  | $size | ) |
| static

Returns the size of the file in a shortened form useful for printing to the user, the returned value is an array with the filesize, the size as a shortened string and the unit. The keys used for fetching the various items in the array are: "size" - The full file size "size-string" - The shortened file size as a string "unit" - The unit for the shortened size, either B, KB, MB or GB

Definition at line 220 of file ezpbfile.php.

References $size.

Referenced by eZVirtualFile\siFileSize().

## ◆ size()

eZPBFile::size | ( |  | ) |

Returns the file size.

Definition at line 205 of file ezpbfile.php.

References $FileSize.

## ◆ tmpName()

eZPBFile::tmpName | ( |  | ) |

Returns the temporary file name.

Definition at line 251 of file ezpbfile.php.

References $TmpFileName.

## ◆ type()

eZPBFile::type | ( |  | ) |

Returns the file type.

Definition at line 197 of file ezpbfile.php.

References $FileType.

## ◆ unlink()

static eZPBFile::unlink | ( |  | $filename | ) |
| static

Same as unlink(), but prepends $siteDir if $filename not empty.

Definition at line 352 of file ezpbfile.php.

References $GlobalSiteIni, and file_exists().

Referenced by eZGPG\__construct(), eZTemplate\clearCache(), eZMedia\delete(), eZVirtualFile\delete(), eZImage\delete(), eZImageVariation\delete(), deleteCache(), eZPBImageFile\scaleCopy(), eZVirtualFile\setFile(), and unlinkWild().

## Member Data Documentation

## ◆ $FileName

eZPBFile::$FileName

Definition at line 438 of file ezpbfile.php.

Referenced by name().

## ◆ $FileSize

eZPBFile::$FileSize

Definition at line 441 of file ezpbfile.php.

Referenced by size().

## ◆ $FileType

eZPBFile::$FileType

Definition at line 440 of file ezpbfile.php.

Referenced by type().

## ◆ $TmpFileName

eZPBFile::$TmpFileName

Definition at line 439 of file ezpbfile.php.

Referenced by tmpName().

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

- ezpbfile.php

Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.