Prefixes for files on R2
I understand that R2 is object storage and therefore the concept of "folders" is not a natural one for R2. However, I do see a checkboxes in the UI that says "View prefixes as directories". Does anyone know which prefix I can use? I have tried
"folder.myfile.csv" and "folder/myfile.csv" but neither create the logical folder I am looking for. Any ideas?
6 Replies
Once you enable that, it just uses
/
, you can see in the API Request it sends. The API Supports any, but the dash just does /
If you're uploading it from the dashboard, create the folder structure you want, like the folder named "folder" and then move/create myfile.csv, and then select select from computer "folder" and then select the "folder" folder, and it should show "Folder: folder" with the upload option in the windows popup, and then you should see it uploading the directoryI also believe that if you only have one file using the prefix then it will show the full name
I was messing around with a test bucket, single file, to verify I wasn't crazy, just a single test/hi/test.txt file and it shows the full structure fine, so that shouldn't be the block there
OK that makes sense. Let me clone some file to see if the "/" works when there are multiple files...
Hmmm. Didnt work for me. For some reason my "/" are being converted to colons
I am uploading from a Mac
Wait let me try what you mentioned earlier about creating the folders etc.
OK you were right. That did the truck. Creating the folder on my mac and then uploading the folder itself did the trick. Thank you.