title: using filepond with react and want to validate or prevent same name upload
body: <p>For File multiple upload using <code>&lt;FilePond&gt;</code> I want to make sure there’s no duplicate file name, like if there’s two file having same name then it should be like file.pdf and another file should get file(1).pdf and so on. 
  How can I do this?</p>
  
  <pre><code> &lt;FilePond
                                      ref={ref =&gt; this.pond = ref}
                                      allowMultiple={true}
                                      acceptedFileTypes= 'application/pdf'
                                      onaddfile={async (error, fileItem) =&gt; {
                                          let obj = {};
                                          obj.id = fileItem.id;
                                          obj.name = fileItem.file.name;
                                          //obj.filestring = await this.toBase64(fileItem.file);
                                          obj.file=fileItem.file;
                                          obj.fileinProgress = false;
                                          obj.date = this.state.date;
                                          obj.report_type = this.state.selectedButton;
                                          obj.fileItem = fileItem.fileType;
                                          obj.readyToUpload = true;
                                          obj.fileUploaded = false;
                                          if (fileItem.fileType === 'application/pdf') {
                                              this.setState({ ["files" + obj.id]: obj});
                                          } else {
                                              toast.error("You can only upload PDF file");
                                          }
                                      }} /&gt;
  </code></pre>