Hello, everyone I have R2 bucket inside

Hello, everyone I have R2 bucket inside and i have two directories, i want to upload an image into the profile-pictures directory in the R2 bucket I tried this but it only uploading into the main bucket, not inside the "profile-pictures" directory let key = "profile-pictures/profilepic" + await generateToken(5) await c.env.BC.put(key, payload.file); I searched for 2 hours, but I couldn't find the documentation about that. Please help if you know the solution. Thank you
4 Replies
fre2mansur
fre2mansurOP5mo ago
please share any info about uploading in to the directory
Chaika
Chaika5mo ago
directories don't exist, they're entirely virtual and only "exist" on list time where you can pass the delimiter you want to use. The dash by default lists objects with the /. You'd have to be more specific in what sense it's not working
fre2mansur
fre2mansurOP4mo ago
to organize my assets i want to upload in to the directory but its not uploading in to the directory but uploading to the main bucket
fre2mansur
fre2mansurOP4mo ago
let key = "./profile-pictures/profilepic" + await generateToken(5) await c.env.BC.put(getKey, payload.file);
No description
Want results from more Discord servers?
Add your server