imagekit-developer / imagekit-react

React SDK for using ImageKit.io
https://imagekit.io
MIT License
102 stars 28 forks source link

Using IKUpload and check file size upload #119

Closed ducyb782001 closed 1 year ago

ducyb782001 commented 1 year ago

Is the any way to using IK Upload and check file size upload, if file size chosen is more than 5mb => Stop process of upload. Many thanks

imagekitio commented 1 year ago

Please use validateFile to run any custom validation logic.

See this sample - https://github.com/imagekit-samples/quickstart/blob/master/react/src/App.js#L53

validateFile={file => file.size < 5242880}