PHP 클래스 AppserverIo\Appserver\ServletEngine\Http\Part

상속: implements AppserverIo\Psr\HttpMessage\PartInterface
파일 보기 프로젝트 열기: appserver-io/appserver 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$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