Custom AJAX request for Ant Design Upload Component
If you want to implement your own upload AJAX handler for the React Ant Design Library Upload or Dragger components then the docs may not be much help. The missing details are below:
You just need to implement a customRequest function that accepts an object containing two callback functions: onSuccess, onError and the file to be uploaded. You just need to do whatever custom upload stuff you have to do in this function and then call either onSuccess() or onError() as appropriate when you get your response back. You don’t have to pass any parameters to these functions.