Upload multiple images to ImageKit through the provided React SDK

836 views Asked by At

We use the React SDK, which is provided by ImageKit, to upload images directly to ImageKit from the frontend. (The details are not important for this problem.)

It looks like this:

<IKUpload
    onError={onError}
    onSuccess={onSuccess}
/>

and all is working smoothly as expected.

BUT - Now we want the user to be able to select multiple images and also upload them all in one step.

The PROBLEM - When adding "multiple" to IKUpload like that:

<IKUpload
     onError={onError}
     onSuccess={onSuccess}
     multiple
 />

ImageKit only uploads the first selected image.

How can we make this work by using the SDK only?

1

There are 1 answers

0
Ahmed Adel On

I was facing this problem also, I found that you can't upload multiple files from the client side as stated here, so the only way to solve this problem is to use server-side uploading.

you can find more about server-side here