Can't upload streams to R2 because of HTTP 1

For Workes & Pages, what is the name of the domain?

/

What is the error message?

(failed)net::ERR_H2_OR_QUIC_REQUIRED

What is the issue or error you’re encountering

It’s impossible to upload a ReadableStream to R2 because it only accepts HTTP/1 requests, which do not support streams. Using a custom domain (which have HTTP/2 enabled) is not possible because they’re read-only and do not follow the S3 API specs (so it’s impossible to use presigned URLs on the custom domain). It’s a problem for us, because we want our members to encrypt files on their browser before uploading them. If we don’t leverage streaming, it takes way too much RAM and makes it impossible to upload large files.

Hi @florianernst59,

I’m checking with our dedicated team if there is a workaround for this.

Hi again @florianernst59,

The team suggested that a potential workaround could be to use multipart uploads so that you can encrypt and upload in chunks and not use too much memory.

However, please note that with presigned URLs this means a unique signed URL per part.

You could also leverage temporary access credentials:

Which would allow you to do the request signing on the client side. Something like aws4fetch can make this easier.

I hope this helps.

1 Like