type FileType = Parameters<GetProp<UploadProps, 'beforeUpload'>>[0]; const getBase64 = (img: FileType, callback: (url: string) => void) => { const reader = new FileReader(); reader.addEventListener('load', () => callback(reader.result as string)); reader.readAsDataURL(img); };
getBase64(file.originFileObj as FileType, (url) => { console.log(url) });