Reputation: 3
I have implemented antd-img-crop on image upload for my react app. I want to skip the crop/resize if the image file selected is .svg format as the svg file gets corrupted after uploading.
Upvotes: 0
Views: 1205
Reputation: 11
beforeCrop prop of ImgCrop component give you access to the file object, using which you can validate the type of file that's being uploaded.
<ImgCrop beforeCrop={file => console.log(file)}>
<Upload>+ Add image</Upload>
</ImgCrop>
Upvotes: 1