title: How to implement a retry functionality to Ant Design's Upload Component if uploading a file fails?
body: <p>I am using ReactJS, and working with uploading pictures. For this, I am using Ant Design's (version 4.6) upload component. In certain scenarios my upload fails and for those scenarios I want to add a retry functionality which would upload the picture again without having to choose it again, but I cannot figure out a way to do this. Any help would be appreciated. Thanks!</p>
  <p>This is my code block where I am using upload component:</p>
  <pre><code>&lt;Form.Item name=&quot;my_photos&quot;  colon={false}&gt;
    {getFieldDecorator(&quot;my_photos&quot;, {
    valuePropName: &quot;my_photos&quot;,
    getValueFromEvent: e =&gt; e &amp;&amp; e.fileList,
    rules: [{ required: false, message: 'Upload at least two photos' }],
    })(
   &lt;div className=&quot;d-flex&quot;&gt;
      &lt;Upload {...Constants.props} 
        multiple={true}  
        listType=&quot;text&quot; 
        className=&quot;uploadbtn&quot;
        progress= {{
        strokeColor: {
        '0%': '#108ee9',
      ' 100%': '#87d068',
         },
         strokeWidth: 3,
         format: percent =&gt; `${parseFloat(percent.toFixed(2))}%`,
         }}&gt;                                      
           &lt;div&gt;Browse&lt;/div&gt;                                                            
      &lt;/Upload&gt;
  &lt;/div&gt;
  )}
  &lt;/Form.Item&gt;
  </code></pre>
  <p>This is another named as Constants in my project, which contains my custom request for upload:</p>
  <pre><code>export const props = {
      customRequest({
        action,
        data,
        file,
        filename,
        headers,
        onError,
        onProgress,
        onSuccess,
        withCredentials
      }) {
        var jwt_token = localStorage.getItem(&lt;Token_Name&gt;);
        AWS.config.update({
            region: &lt;Region Name&gt;,
            credentials: new AWS.CognitoIdentityCredentials({
                IdentityPoolId: &lt;PoolID&gt;,
                Logins: { 
                    &lt;Login&gt;: jwt_token,
                }
            })
        });
    
        const S3Obj = new AWS.S3();
     
    
        const objectParameters = {
            Bucket: &quot;my_bucket&quot;,
            Key: &quot;my_bucket_files&quot; + &quot;/&quot; + file.uid + &quot;/&quot; + file.name,
            ACL: 'public-read',
            Body: file,
            ContentType: file.type
        };
    
        S3Obj.putObject(objectParameters)
          .on(&quot;httpUploadProgress&quot;, function({ loaded, total }) {
            onProgress(
              {
                percent: Math.round((loaded / total) * 100)
              },
              file
            );
          })
          .send(function(err, data) {
            if (err) {
              onError();
              message.error('Upload Failed. Try Again.');
              console.log(err.code);
              console.log(err.message);
            } else {
              onSuccess(data.response, file);
              message.success('Upload Successful!');
            }
          });
      }
    };
  
  
  </code></pre>