Skip to content

fix:complete the function of 'accept' option - #455

Open
Coloey wants to merge 1 commit into
react-component:masterfrom
Coloey:master
Open

fix:complete the function of 'accept' option#455
Coloey wants to merge 1 commit into
react-component:masterfrom
Coloey:master

Conversation

@Coloey

Copy link
Copy Markdown
constuploaderProps={action: '/upload.do',data: {a: 1,b: 2},multiple: true,beforeUpload(file){console.log('beforeUpload',file.name);},onStart: file=>{console.log('onStart',file.name);},onSuccess(file){console.log('onSuccess',file);},onProgress(step,file){console.log('onProgress',Math.round(step.percent),file.name);},onError(err){console.log('onError',err);},capture: 'user',accept:'.jpg',directory: false};

when I try to upload pictures in .jpg format, pictures in .png format can also be uploaded,and I try to solve this problem,here is my programme

onChange=(e: React.ChangeEvent<HTMLInputElement>)=>{const{ accept, directory }=this.props;const{ files }=e.target;constacceptedFiles=[...files].filter((file: RcFile)=>!directory&&attrAccept(file,accept),);this.uploadFiles(acceptedFiles);this.reset();};

@vercel

vercelBot commented Oct 17, 2022

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for Git ↗︎

NameStatusPreviewUpdated
upload✅ Ready (Inspect)Visit PreviewOct 17, 2022 at 2:09PM (UTC)

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

@Coloey