Exponential Basic 2.4.0.1 Exponential Basic CMS — PHP Class Reference

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

## Public Member Functions
| __construct ()
| isMedia ()

## Static Public Member Functions
& | information ( $file, $use_default=false)
& | defaultInformation ()
Static Public Member Functions inherited from eZFile
static | create ( $filename, $directory=false, $data=false, $atomic=false)
static | suffix ( $filename)
static | isWriteable ( $filename)
static | rename ( $srcFile, $destFile, $mkdir=false, $flags=0)
static | download ( $file, $isAttachedDownload=true, $overrideFilename=false, $startOffset=0, $length=false)
static | downloadHeaders ( $file, $isAttachedDownload=true, $overrideFilename=false, $startOffset=0, $length=false, $fileSize=false)
static | downloadContent ( $file, $startOffset=0, $length=false)

## Additional Inherited Members
Public Attributes inherited from eZFile
const | READ_PACKET_SIZE = 16384
const | CLEAN_ON_FAILURE = 1
const | APPEND_DEBUG_ON_FAILURE = 2

## Detailed Description

! eZCommon The eZMediaFile class handles fileuploads, and media specific functions like scale.

NOTE: this class requires the MediaMagic convert program. You can get it from: http://www.wizards.dupont.com/cristy/MediaMagick.html

Example:

You need a HTML file like:
<form method="post" action="script_url" enctype="multipart/form-data">
<input type="hidden" name="max_file_size" value="3000000">
Media:<br>
<input name="userfile" type="file" /><br>
<input type="submit" value="OK" />
</form>
And in the script_url you put code like:
$file = new eZMediaFile();
// note: userfile is not a variable it's a "text" string. The value
// must be the same as the one used in the input.
if ( $file->getFile( "userfile" ) )
{
print( $file->name() . " uploaded successfully" );
}
else
{
print( "Error uploading file." );
}
eZMediaFile
Definition: ezmediafile.php:68
$file
$file
Definition: ezfilemanager/user/filedownload.php:35

Definition at line 67 of file ezmediafile.php.

## Constructor & Destructor Documentation

## ◆ __construct()

eZMediaFile::__construct | ( |  | ) |

Constructs a new eZMediaFile object.

Definition at line 72 of file ezmediafile.php.

## Member Function Documentation

## ◆ defaultInformation()

& eZMediaFile::defaultInformation | ( |  | ) |
| static

Returns the default media info structure, which uses the mpeg format. This is used for returning a standard info structure if the file format is unsupported.

Definition at line 140 of file ezmediafile.php.

References $ret.

Referenced by information().

## ◆ information()

& eZMediaFile::information | ( |  | $file,
|  |  | $use_default = `false`
| ) |  |
| static

Returns a information structure of the media file. The structure is an associative array with the following contents: "suffix" - The suffix of the media file, for instance: mpeg, avi or rm "dot-suffix" - The suffix of the media file with a dot, is empty if not supported. "media-type" - The media type, for instance: media/jpeg, media/png or media/gif "support" - True if the media type is supported.

Definition at line 105 of file ezmediafile.php.

References $file, $ret, $suffix, and defaultInformation().

Referenced by eZMedia\setMedia().

## ◆ isMedia()

eZMediaFile::isMedia | ( |  | ) |

Returns true if the uploaded file is an media (As perceived by Apache). Warning!! Do not use this to figure out if a file is an true media, only to see if Apache can serve it directly.

Definition at line 82 of file ezmediafile.php.

References $ret.

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

- ezmediafile.php

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