#Bun S3 client :: list objects in bucket
1 messages · Page 1 of 1 (latest)
not supported for the moment
this is a big need for me as well! Would look forward to see this implemented!
i just added support for DeleteObjects
https://github.com/oven-sh/bun/pull/16847
ListObjects is on my list
What does this PR do?
Closes #16520
This PR adds full support for AWS DeleteObjects operations, with the same Input/Output as @aws-sdk/s3-client
const client = new S3Client();
try {
const respon...
the current implementation of AWS SignatureV4 in Bun is difficult to maintain which blocks other API implementations
Yeah im using r2.. dont have list for some reason
How do you know if a folder exists or not ? .. anyone know?
There's no "folder" concept in S3
Imagine you have following Object names:
pictures/2024/summer.png
pictures/2023/summer.png
If you want to know if theres any Object with prefix pictures/2024/
You have to list Objects, then check for an Object name starting with pictures/2024/+
with ListObjects API which im working on, you will have an option called prefix which will filter Object keys by prefix
then in the returned response you can check if it returned any object or its empty
Thought it created a folder in r2 in the bucket if prefix the folder/filename .. so i need list to find anything inside folder/ .. which doesnt exist right?
Yet i mean
In this case folder/filename is an "empty" Object, or its "some virtual" folder handled by R2
in the S3 protocol there's no folder, but you can create an Object called pictures/2024 then created another Object pictures/2024/summer.png
Deleting pictures/2024 will not delete pictures/2024/summer.png
If i simply do file.exists(/folder) it returns false .. if i do file.exists(/folder/filename) it return true.. i just wanted to know whether the prefix folder exists or not
Im not familiar at all with R2, all im taling about is S3 protocol
R2 is based on s3 i think same lib
If you are talking about Bun's "lib" then all these is handled by the servers (R2, AWS S3)
Bun only parses and returns the response to you
If R2 says theres a folder but S3 says theres no folder it means R2 (CloudFlare server) isnt 100% S3 protocol compatible