#How to set known length for R2 put?
13 messages · Page 1 of 1 (latest)
I already put in the content-length headers 🤔
If I pass the ReadableStream from request.body it will upload successfully
If I new ReadableStream manually, it'll throw the error.
you should use a FixedLengthStream if your creating your own
anyway I can get the length from the original ReadableStream?
I've read the first N bytes of request.body for the instruction description. The latter part of body is data as parameters for the instruction.
How about, first fetch with the instruction body and the second fetch with data?
You should be able to get this from the Content-Length header on the request
I can't, on the other side I only got ReadableStream without the headers.
Isn’t the stream coming from request.body? Could you read that length, then subtract N for the data stream?