@@ -52,7 +52,9 @@ $client = new Client(
52
52
password: getenv("OPTIONAL_IMAGEKIT_IGNORES_THIS") ?: "do_not_set",
53
53
);
54
54
55
- $response = $client->files->upload(file: 'file', fileName: "file-name.jpg");
55
+ $response = $client->files->upload(
56
+ file: "https://www.example.com/public-url.jpg", fileName: "file-name.jpg"
57
+ );
56
58
57
59
var_dump($response->videoCodec);
58
60
```
@@ -74,7 +76,9 @@ When the library is unable to connect to the API, or if the API returns a non-su
74
76
use ImageKit\Core\Exceptions\APIConnectionException;
75
77
76
78
try {
77
- $response = $client->files->upload(file: 'file', fileName: "file-name.jpg");
79
+ $response = $client->files->upload(
80
+ file: "https://www.example.com/public-url.jpg", fileName: "file-name.jpg"
81
+ );
78
82
} catch (APIConnectionException $e) {
79
83
echo "The server could not be reached", PHP_EOL;
80
84
var_dump($e->getPrevious());
@@ -122,7 +126,7 @@ $client = new Client(maxRetries: 0);
122
126
// Or, configure per-request:
123
127
124
128
$result = $client->files->upload(
125
- file: 'file' ,
129
+ file: "https://www.example.com/public-url.jpg" ,
126
130
fileName: "file-name.jpg",
127
131
requestOptions: RequestOptions::with(maxRetries: 5),
128
132
);
@@ -144,7 +148,7 @@ Note: the `extra*` parameters of the same name overrides the documented paramete
144
148
use ImageKit\RequestOptions;
145
149
146
150
$response = $client->files->upload(
147
- file: 'file' ,
151
+ file: "https://www.example.com/public-url.jpg" ,
148
152
fileName: "file-name.jpg",
149
153
requestOptions: RequestOptions::with(
150
154
extraQueryParams: ["my_query_parameter" => "value"],
0 commit comments