PHP WebSocket2 Library
PHP5 Library for browsing web
|
HTTP file attachment class. More...
Public Member Functions | |
__construct ($filename, $file_path) | |
Constructor. More... | |
setPartSize ($part_size) | |
Sets size of part of file data in bytes that will be sent to socket at once. More... | |
getPartSize () | |
Returns size of part of file data in bytes that will be sent to socket at once. More... | |
writeTo (HttpSocket $socket) | |
Writes raw attachment data to HttpSocket $socket. More... | |
getSize () | |
Public Member Functions inherited from HttpAttachment | |
__construct ($filename) | |
Constructor. More... | |
setFilename ($filename) | |
Sets attachment file name. More... | |
setContentType ($content_type) | |
Sets attachment content-type. More... | |
getFilename () | |
Returns attachment file name. More... | |
getContentType () | |
Returns attachment content-type. More... | |
writeTo (HttpSocket $socket) | |
Writes raw attachment data to HttpSocket $socket. More... | |
getSize () | |
Returns attachment size in bytes. More... | |
HTTP file attachment class.
__construct | ( | $filename, | |
$file_path | |||
) |
Constructor.
string | $filename | Attachment file name (this will be sent over HTTP) |
string | $file_path | Attachment file path |
WebRequestException | if an error occured when requesting file size |
getPartSize | ( | ) |
Returns size of part of file data in bytes that will be sent to socket at once.
Default value is 2048 bytes.
int | Size of part of file data in bytes that will be sent to socket at once |
setPartSize | ( | $part_size | ) |
Sets size of part of file data in bytes that will be sent to socket at once.
Default value is 2048 bytes.
int | $part_size | Size of part of file data in bytes that will be sent to socket at once |
writeTo | ( | HttpSocket | $socket | ) |
Writes raw attachment data to HttpSocket $socket.
HttpSocket | $socket | Socket to send data to |
WebRequestException | if an error occured when opening or reading file |