Uploading Images & Videos
Use the CldUploadButton or CldUploadWidget components to add upload capabilities to your app.
The components utilize the Cloudinary Upload Widget, built for Next.js.
Example
<CldUploadButton
className={styles.button}
onUpload={(error, result, widget) => {
setResource(result?.info); // Updating local state with asset details
widget.close(); // Close widget immediately after successful upload
}}
signatureEndpoint="/api/sign-cloudinary-params"
uploadPreset="next-cloudinary-signed"
>
Upload to Cloudinary
</CldUploadButton>