Skip to content

Commit 694bff3

Browse files
committed
fix example
1 parent 958e862 commit 694bff3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ import { IKImage, IKVideo, IKContext, IKUpload } from 'imagekitio-react'
205205
}
206206
]
207207
}}
208-
checks="file.size < 1mb" // To run server side checks before uploading files
208+
checks=`"file.size" < "1mb"` // To run server side checks before uploading files. Notice the quotes around file.size and 1mb.
209209
/>
210210
</IKContext>
211211
```
@@ -627,7 +627,7 @@ The SDK provides the `IKUpload` component to upload files to the [ImageKit Media
627627
| urlEndpoint | String | Optional. If not specified, the URL-endpoint specified in the parent `IKContext` component is used. For example, https://ik.imagekit.io/your_imagekit_id/endpoint/ |
628628
| publicKey | String | Optional. If not specified, the `publicKey` specified in the parent `IKContext` component is used. |
629629
| authenticator | ()=>Promise<{signature:string,token:string,expiry:number}> | Optional. If not specified, the `authenticator` specified in the parent `IKContext` component is used. |
630-
| checks | String | Optional. Run server-side checks before uploading files. For example, `size < 1mb` will check if the file size is less than 1 MB. Check [Upload API docs](https://imagekit.io/docs/api-reference/upload-file/upload-file#upload-api-checks) to learn more. |
630+
| checks | String | Optional. Run server-side checks before uploading files. For example, `"file.size" < "1mb"` will check if the file size is less than 1 MB. Check [Upload API docs](https://imagekit.io/docs/api-reference/upload-file/upload-file#upload-api-checks) to learn more. Notice the quotes around `file.size` and `1mb`; otherwise, you will get an error `Your request contains invalid syntax for the checks parameter.` |
631631

632632

633633
> Make sure that you have specified `authenticator` and `publicKey` in `IKUpload` or in the parent `IKContext` component as a prop. The authenticator expects an asynchronous function that resolves with an object containing the necessary security parameters i.e `signature`, `token`, and `expire`.

0 commit comments

Comments
 (0)