|
| __construct (Client $client) |
|
| upload ($res, $filename, $content_type= 'application/octet-stream') |
|
| download ($model, $id, $res=null) |
|
| info ($model, $id) |
|
used to upload and download files
OneCRM\APIClient\Files::download |
( |
|
$model, |
|
|
|
$id, |
|
|
|
$res = null |
|
) |
| |
Downloads a file
Use this method to download a file attached to document, document revision or note.
- Parameters
-
$model | One of Note , Document , DocumentRevision |
$id | Document, revision, or note ID |
$res | String with file name or stream resource. Optional, if present, downloaded file content will be saved to file or written to stream |
- Returns
- A stream resource with contents of the file
- Exceptions
-
OneCRM\APIClient\Files::info |
( |
|
$model, |
|
|
|
$id |
|
) |
| |
Retrieves information about a file
Use this method to get information about a file attached to document, document revision or note
- Parameters
-
$model | One of Note , Document , DocumentRevision |
$id | Document, revision, or note ID |
- Returns
- Array with file info
- Exceptions
-
OneCRM\APIClient\Files::upload |
( |
|
$res, |
|
|
|
$filename, |
|
|
|
$content_type = 'application/octet-stream' |
|
) |
| |
Uploads a temporary file
You can pass file contents using $res parameter in a number of ways:
- use a string with file content
- use resource returned by a call to fopen()
- use a stream resource
- Parameters
-
$res | File content |
$filename | File name |
content_type | File content type |
- Returns
- Temporary file ID.
- Exceptions
-
The documentation for this class was generated from the following file: