eZPublish  3.9
eZHTTPFile Class Reference

Provides access to HTTP post files. More...

Public Member Functions

attribute ($attr)
 
 attributes ()
 
 canFetch ($http_name, $maxSize=false)
 
 eZHTTPFile ($http_name, $variable)
 
fetch ($http_name)
 
 hasAttribute ($attr)
 
 setMimeType ($mime)
 
 storageDir ($sub_dir=false)
 
 store ($sub_dir=false, $suffix=false, $mimeData=false)
 

Public Attributes

 $Filename
 The local filename. More...
 
 $HTTPName
 The name of the HTTP file. More...
 
 $IsTemporary
 Whether the file is a temporary file or if it has been moved(stored). More...
 
 $MimeCategory
 The mimetype category (first part) More...
 
 $MimePart
 The mimetype type (second part) More...
 
 $OriginalFilename
 The original name of the file from the client. More...
 
 $Size
 The size of the local file. More...
 
 $Type
 The mime type of the file. More...
 

Detailed Description

Provides access to HTTP post files.

This class provides easy access to files posted by clients over HTTP. The HTTP file will be present as a temporary file which can be moved to store it, if not the file will be removed when the PHP script is done.

Member Function Documentation

& eZHTTPFile::attribute (   $attr)
Returns
the value for the attribute $attr or null if the attribute does not exist.
eZHTTPFile::attributes ( )
Returns
an array with the attributes for this object.

Referenced by hasAttribute().

eZHTTPFile::canFetch (   $http_name,
  $maxSize = false 
)
Returns
true if the HTTP file $http_name can be fetched. If $maxSize is given, the function returns 0 (EZ_UPLOADEDFILE_OK) if the file can be fetched, -1 (EZ_UPLOADEDFILE_DOES_NOT_EXIST) if there has been no file uploaded, -2 (EZ_UPLOADEDFILE_EXCEEDS_PHP_LIMIT) if the file was uploaded but size exceeds the upload_max_size limit (set in the PHP configuration), -3 (EZ_UPLOADEDFILE_EXCEEDS_MAX_SIZE) if the file was uploaded but size exceeds $maxSize or MAX_FILE_SIZE variable in the form.

Referenced by checkRelationActions(), eZContentUpload\fetchHTTPFile(), eZImageType\fetchObjectAttributeHTTPInput(), eZMediaType\fetchObjectAttributeHTTPInput(), eZBinaryFileType\fetchObjectAttributeHTTPInput(), eZStepSiteTypes\uploadPackage(), eZStylePackageCreator\validateCSSFile(), eZStylePackageCreator\validateImageFiles(), eZImageType\validateObjectAttributeHTTPInput(), eZMediaType\validateObjectAttributeHTTPInput(), eZBinaryFileType\validateObjectAttributeHTTPInput(), and eZPackageCreationHandler\validatePackageThumbnail().

eZHTTPFile::eZHTTPFile (   $http_name,
  $variable 
)

Initializes with a name and http variable.

Parameters
$http_nameName of the HTTP variable
$variableThe HTTP variable structure

Referenced by fetch().

eZHTTPFile::hasAttribute (   $attr)
Returns
true if the attribute $attr exists
eZHTTPFile::setMimeType (   $mime)

Changes the MIME-Type to $mime.

eZHTTPFile::storageDir (   $sub_dir = false)
Returns
the directory where the file should be stored.
eZHTTPFile::store (   $sub_dir = false,
  $suffix = false,
  $mimeData = false 
)

Stores the temporary file to the destination dir $dir.

Member Data Documentation

eZHTTPFile::$Filename

The local filename.

Referenced by attribute().

eZHTTPFile::$HTTPName

The name of the HTTP file.

eZHTTPFile::$IsTemporary

Whether the file is a temporary file or if it has been moved(stored).

Referenced by attribute().

eZHTTPFile::$MimeCategory

The mimetype category (first part)

Referenced by attribute(), storageDir(), and store().

eZHTTPFile::$MimePart

The mimetype type (second part)

Referenced by attribute().

eZHTTPFile::$OriginalFilename

The original name of the file from the client.

Referenced by attribute().

eZHTTPFile::$Size

The size of the local file.

Referenced by attribute().

eZHTTPFile::$Type

The mime type of the file.

Referenced by attribute().


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