For image storage which would be better r2 or images?
I would nee d the following
- images to be stored under a user object path i.e. /user1/imagename.jpg
- storing only images no other types.
- do not really need image manipulations software
- need client side uploading of images
- can be publicly available for now but only logged in users that have access to the object path should be able to see their own images.
which one would be more suitable r2 or images?
7 Replies
If you dont need to manipulate (resize, optimise, reformat) the images then R2 will be perfect
You can probably find a way to restrict it to only images within a worker
Would it be possbible to upload directly from the front end without the need for a worker or any backend code?
i can do the same with s3 using s3 direct upload.
You can, but you shouldn’t, since then your API token is the publicized
You can use presigned URLs, though it makes it trickier to enforce specific formats/file types
Doesn’t that require a backend of some kind to compute the URL?
I suppose yeah
Unsure how s3 direct upload works
Yeah it does - it's a non-intensive process that doesn't even require an internet connection but it needs to use the secret key so it'll need a backend
I'd recommend a Worker with
aws4fetch
if you're looking for a backend