@@ -52,7 +52,9 @@ $client = new Client(
5252 password: getenv("OPTIONAL_IMAGEKIT_IGNORES_THIS") ?: "do_not_set",
5353);
5454
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+ );
5658
5759var_dump($response->videoCodec);
5860```
@@ -74,7 +76,9 @@ When the library is unable to connect to the API, or if the API returns a non-su
7476use ImageKit\Core\Exceptions\APIConnectionException;
7577
7678try {
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+ );
7882} catch (APIConnectionException $e) {
7983 echo "The server could not be reached", PHP_EOL;
8084 var_dump($e->getPrevious());
@@ -122,7 +126,7 @@ $client = new Client(maxRetries: 0);
122126// Or, configure per-request:
123127
124128$result = $client->files->upload(
125- file: 'file' ,
129+ file: "https://www.example.com/public-url.jpg" ,
126130 fileName: "file-name.jpg",
127131 requestOptions: RequestOptions::with(maxRetries: 5),
128132);
@@ -144,7 +148,7 @@ Note: the `extra*` parameters of the same name overrides the documented paramete
144148use ImageKit\RequestOptions;
145149
146150$response = $client->files->upload(
147- file: 'file' ,
151+ file: "https://www.example.com/public-url.jpg" ,
148152 fileName: "file-name.jpg",
149153 requestOptions: RequestOptions::with(
150154 extraQueryParams: ["my_query_parameter" => "value"],
0 commit comments