Метод | Описание | |
---|---|---|
__construct ( |
Constructor | |
createGroup ( array $files ) : uploadcare\Group | Create group from array of File objects | |
fromContent ( string $content, string $mime_type ) : |
Upload file from string using mime-type. | |
fromPath ( string $path, string | boolean $mime_type = false ) : |
Upload file from local path. | |
fromResource ( resource $fp ) : |
Upload file from file pointer | |
fromUrl ( string $url, boolean $check_status = true, integer $timeout = 1, integer $max_attempts = 5 ) : |
Upload file from url and get File instance | |
status ( string $token ) : object | Check file status. |
Метод | Описание | |
---|---|---|
__initRequest ( $type, array $data = null ) : resource | Init upload request and return curl resource | |
__runRequest ( $ch ) : object | Run prepared curl request. | |
__setData ( $ch, array $data = [] ) : void | Set data to be posted on request | |
__setHeaders ( $ch ) : void | Set all the headers for request and set return transfer. | |
__setRequestType ( resource $ch ) : void | Set request type for curl resource |
public createGroup ( array $files ) : uploadcare\Group | ||
$files | array | |
Результат | uploadcare\Group |
public fromContent ( string $content, string $mime_type ) : |
||
$content | string | |
$mime_type | string | |
Результат |
public fromResource ( resource $fp ) : |
||
$fp | resource | |
Результат |
public fromUrl ( string $url, boolean $check_status = true, integer $timeout = 1, integer $max_attempts = 5 ) : |
||
$url | string | An url of file to be uploaded. |
$check_status | boolean | Wait till upload is complete |
$timeout | integer | Wait $timeout seconds between status checks |
$max_attempts | integer | Check status no more than $max_attempts times |
Результат |