Question

Why doesn't spaces object storage show tree when I upload files via api key?

I uploaded some files into a non existing folder in my space object storage via api key. The upload was fine, but when I went to the dashboard I couldn’t see the folder containing the files. I had to create the trees by hand to see them


Submit an answer


This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Bobby Iliev
Site Moderator
Site Moderator badge
November 29, 2023
Accepted Answer

Hey there,

Firstly, happy to hear that you’ve been successfully uploading your files! Regarding the invisible folder issue in the Spaces dashboard, this is actually a common trait of object storage systems, not just a quirk of DigitalOcean Spaces.

Object storage systems like Spaces use what’s known as a flat namespace. This means that, unlike traditional file systems where folders are actual entities that hold files, Spaces treats everything as an object. So, when you upload a file to a path like nonexistingfolder/myfile.txt, Spaces doesn’t create a ‘nonexistingfolder’ directory. Instead, it creates an object named nonexistingfolder/myfile.txt.

In Spaces, folders are more virtual than physical. They don’t exist in the same way as on a regular filesystem. The dashboard uses these virtual folders to make things easier to navigate, but it doesn’t automatically parse the object names into a folder structure. That’s why when you upload a file using a path, the dashboard might not immediately reflect it in a folder tree structure.

This leads to a difference in experience between using the API and the dashboard. The API allows you to specify any path for your files, but the dashboard might require actual interaction, like creating the folder manually, to display these paths as folders.

To better assist you and others who might face this, could you share the code snippet you used to upload the files? This will help me provide more specific advice on how to modify your upload process. Ensuring the dashboard recognizes your intended folder structure might just need a slight tweak in your code.

Once I have a look at your code, I might be able to figure out a way to make your uploads dashboard-friendly right from the get-go. This will save you the manual effort of creating directory trees and streamline your workflow.

Looking forward to helping you out more!

Happy coding!

- Bobby

alexdo
Site Moderator
Site Moderator badge
December 7, 2023

Heya, @volleytechsrls

As Bobby explained creating the folder hierarchy manually ensures that the folder is visible in the dashboard and that files are organized logically. This is especially important for managing large volumes of files and maintaining a clear organizational structure.

While it might seem inconvenient to manually create folders, it’s a necessary step for Object Storage to correctly interpret the file structure and display it properly.

I’ve personally experienced the same issue some time ago and was puzzled if this was an issue from my side, but as we see it’s just we’re expecting the same behaviour as it was a traditional file system.

Regards

Try DigitalOcean for free

Click below to sign up and get $200 of credit to try our products over 60 days!

Sign up

Become a contributor for community

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

DigitalOcean Documentation

Full documentation for every DigitalOcean product.

Resources for startups and SMBs

The Wave has everything you need to know about building a business, from raising funding to marketing your product.

Get our newsletter

Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.

New accounts only. By submitting your email you agree to our Privacy Policy

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.