Comments (4)
Good question, I need better documentation.
TussleStorageR2
has a getFile()
method which returns an R2File
instance.
R2File
has a body
property which exposes a ReadableStream
which handles reassembling the parts in correct order and returning them as a single stream.
If you have thousands of file parts, you will likely need to get a little more creative since you'll probably exhaust the Cloudflare Worker's CPU limits or R2 API call limits, in which case you can devise your own implementation by iterating over the R2File
's keys
array (which is just an ordered array of R2 object keys representing the file parts).
from tussle.
I really appreciate your prompt reply. Let me dig into it a little more and see what I can do. In the end, I think I would need to go through the S3 backend so I can have the object reassembled into one. I hope for R2 worker bindings to support multipart soon.
from tussle.
from tussle.
True, but that gets very expensive very quickly, so it is overall cheaper to buffet through other S3 like service
from tussle.
Related Issues (9)
- Help write unit tests
- How can I get all uploaded file list from storage-r2? HOT 4
- Use crypto.DigestStream in CF Worker environments for chunk checksums
- Implement termination extension
- cloudflare s3 example maybe broken HOT 4
- Handle PATCH offset mismatch with 409 Conflict
- Store write failures should result in 500 or 503 response HOT 1
- POST /files 500 Internal Server Error HOT 13
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tussle.