Uploading to aws presigned url leads to connection timeout

I’m using the following code to upload a file to a presigned url s3:

        const fetchResult = await fetch('https://filesamples.com/samples/document/txt/sample3.txt');
        const length = (await fetchResult.arrayBuffer()).byteLength;
        formData.append('file', fetchResult.body, js.url);

        const final = await fetch(js.url, {
            body: formData as any,
            headers: {
                'content-length': length.toString()
            },
            method: 'POST'
        })

However this is getting an error:

<Error><Code>RequestTimeout</Code><Message>Your socket connection to the server was not read from or written to within the timeout period. Idle connections will be closed.</Message><RequestId>4GEG981FJPY0NGTA</RequestId><HostId>y9w+8E0ZIDDQg9IdH95VmK3cZsorupcC4vhnZTuivvkXQ/+1R2HLsK61BC7B3UnMwMzN92pBcjkeBBKKBztUxA==</HostId></Error>

If I was to upload a straight up string like:

formData.append('file', 'test data, js.url);

and that works without timing out.