mirror of
https://github.com/jonathan-martz/pocketbase-php-sdk.git
synced 2026-04-03 07:27:42 +00:00
update docs for upload
This commit is contained in:
@@ -39,4 +39,7 @@ $pb->collection(collectionIdOrName)->update(string $recordId, array $bodyParams
|
||||
|
||||
// Deletes a single record by its id.
|
||||
$pb->collection(collectionIdOrName)->delete(string $recordId, array $queryParams = []);
|
||||
|
||||
// Custom Logic
|
||||
$pb->collection(collectionIdOrName)->upload('abcdefghijkl','webp', './converted/filepath.png');
|
||||
```
|
||||
|
||||
@@ -55,7 +55,7 @@ class Collection
|
||||
*/
|
||||
public function upload(string $recordId, string $field, string $filepath): void
|
||||
{
|
||||
$ch = curl_init($this->url . "/api/collections/gallery_media/records/" . $recordId);
|
||||
$ch = curl_init($this->url . "/api/collections/".$this->collection."/records/" . $recordId);
|
||||
curl_setopt_array($ch, array(
|
||||
CURLOPT_CUSTOMREQUEST => 'PATCH',
|
||||
CURLOPT_POSTFIELDS => array(
|
||||
|
||||
Reference in New Issue
Block a user