1

I have a propblem with removing file with revert property here is my code :

  server={{
      process: (fieldName, file, progress, load, error) => {
        handelUploadFile(fieldName, file, progress, load, error);
      },
      revert: (uniqueFileId, load, error) => {
        handelDeleteFile(uniqueFileId, load, error);
      },
    }}


  const handelDeleteFile = async (uniqueFileId, load, error) => {
  const key = "DELETE";
  let config = {
  url: "/deletefile",
  method: "delete",
  params: { filenames: uniqueFileId },
  };
  let status;
  const response = await axios(config);
  status = response.status;
  if (status === 200) {
  load(response.status);
  } else {
  error("error in delete file");
  }
  };

by the way i used before another project and that still working with the same code

i change the version og filepond but it didn't work

i tried this code :

 server={{
      revert: (uniqueFileId, load, error) => {
          console.log(uniqueFileId)  // return undefined
      },
    }}

what is problem ?

0 Answers0