PHP Класс AppserverIo\Appserver\ServletEngine\Http\Part

Автор: Tim Wagner ([email protected])
Наследование: implements AppserverIo\Psr\HttpMessage\PartInterface
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$filename string Hold the orig filename given in multipart header
$headers array Holds the header information as array
$inputStream Holds input stream file pointer
$name string The name of the part
$size integer Holds the number of bytes written to inputStream
$tmpFilename string Hold the templary filename.

Открытые методы

Метод Описание
addHeader ( string $name, string $value ) : void Adds header information to the part
delete ( ) : void Deletes the underlying storage for a file item, including deleting any associated temporary disk file.
fromHttpRequest ( AppserverIo\Psr\HttpMessage\PartInterface $httpPart ) : Part Creates a new servlet part instance with the data from the HTTP part.
getContentType ( ) : string Gets the content type of this part.
getFilename ( ) : string Gets the original form filename.
getHeader ( string $name ) : string Returns the value of the specified mime header as a String.
getHeaderNames ( ) : array Gets the header names of this Part.
getHeaders ( string $name = null ) : array Gets the values of the Part header with the given name.
getInputStream ( ) : resource Gets the content of this part as an InputStream
getName ( ) : string Gets the name of this part
getSize ( ) : integer Returns the size of this file.
getTmpFilename ( ) : string Returns the temporary filename.
init ( string $streamWrapper = self::STREAM_WRAPPER_TEMP, integer $maxMemory = 5242880 ) : void Initiates a http form part object
putContent ( string $content ) : void Puts content to input stream.
setFilename ( string $filename ) : void Sets the orig form filename.
setName ( string $name ) : void Sets the name of the part
setTmpFilename ( string $tmpFilename ) : void Sets the temporary filename.
write ( string $fileName ) : integer A convenience method to write this uploaded item to disk.

Описание методов

addHeader() публичный метод

Adds header information to the part
public addHeader ( string $name, string $value ) : void
$name string The header name
$value string The header value for given name
Результат void

delete() публичный метод

Deletes the underlying storage for a file item, including deleting any associated temporary disk file.
public delete ( ) : void
Результат void

fromHttpRequest() публичный статический метод

Creates a new servlet part instance with the data from the HTTP part.
public static fromHttpRequest ( AppserverIo\Psr\HttpMessage\PartInterface $httpPart ) : Part
$httpPart AppserverIo\Psr\HttpMessage\PartInterface The HTTP part we want to copy
Результат Part The initialized servlet part

getContentType() публичный метод

Gets the content type of this part.
public getContentType ( ) : string
Результат string The content type of this part.

getFilename() публичный метод

Gets the original form filename.
public getFilename ( ) : string
Результат string The file's name

getHeader() публичный метод

If the Part did not include a header of the specified name, this method returns null. If there are multiple headers with the same name, this method returns the first header in the part. The header name is case insensitive. You can use this method with any request header.
public getHeader ( string $name ) : string
$name string a String specifying the header name
Результат string The headers value for given name

getHeaderNames() публичный метод

Gets the header names of this Part.
public getHeaderNames ( ) : array
Результат array

getHeaders() публичный метод

Gets the values of the Part header with the given name.
public getHeaders ( string $name = null ) : array
$name string the header name whose values to return
Результат array

getInputStream() публичный метод

Gets the content of this part as an InputStream
public getInputStream ( ) : resource
Результат resource The content of this part as an InputStream

getName() публичный метод

Gets the name of this part
public getName ( ) : string
Результат string The name of this part as a String

getSize() публичный метод

Returns the size of this file.
public getSize ( ) : integer
Результат integer The size of this part, in bytes.

getTmpFilename() публичный метод

Returns the temporary filename.
public getTmpFilename ( ) : string
Результат string The temporary filename

init() публичный метод

Initiates a http form part object
public init ( string $streamWrapper = self::STREAM_WRAPPER_TEMP, integer $maxMemory = 5242880 ) : void
$streamWrapper string The stream wrapper to use per default temp stream wrapper
$maxMemory integer Maximum memory in bytes per default to 5 MB
Результат void

putContent() публичный метод

Puts content to input stream.
public putContent ( string $content ) : void
$content string The content as string
Результат void

setFilename() публичный метод

Sets the orig form filename.
public setFilename ( string $filename ) : void
$filename string The file's name
Результат void

setName() публичный метод

Sets the name of the part
public setName ( string $name ) : void
$name string The part's name
Результат void

setTmpFilename() публичный метод

Sets the temporary filename.
public setTmpFilename ( string $tmpFilename ) : void
$tmpFilename string The temporary filename
Результат void

write() публичный метод

A convenience method to write this uploaded item to disk.
public write ( string $fileName ) : integer
$fileName string The name of the file to which the stream will be written.
Результат integer

Описание свойств

$filename защищенное свойство

Hold the orig filename given in multipart header
protected string $filename
Результат string

$headers защищенное свойство

Holds the header information as array
protected array $headers
Результат array

$inputStream защищенное свойство

Holds input stream file pointer
protected $inputStream

$name защищенное свойство

The name of the part
protected string $name
Результат string

$size защищенное свойство

Holds the number of bytes written to inputStream
protected int $size
Результат integer

$tmpFilename защищенное свойство

Hold the templary filename.
protected string $tmpFilename
Результат string