Your workflow is unique 👨‍💻 -  tell us how you use Dropbox here.

Forum Discussion

Brendan D.'s avatar
Brendan D.
Explorer | Level 4
11 years ago

Wrong character case of folder name when calling listFolder using Sync API

I'm traversing a folder hierarchy and have come across a strange anomaly in the letter case of one of my folders.

When I call listFolder to get the hierarchy of my folders, everything seems normal until it gets down to the third level.

For example, when I fetch the 2nd level in the hierarchy, I get the correct case for all my folders:

DBFileInfo(path='/Share/Attachments', isFolder=YES, modified=2015-02-02 10:43:24 +0000, size=0, thumbExists=NO, icon=folder),
DBFileInfo(path='/Share/Exports', isFolder=YES, modified=2015-02-02 10:43:55 +0000, size=0, thumbExists=NO, icon=folder),
DBFileInfo(path='/Share/Imports', isFolder=YES, modified=2015-02-02 10:43:55 +0000, size=0, thumbExists=NO, icon=folder)

But when I traverse into the /Share/Attachments folder (the 3rd level) and call listFolder again, this is what I get:

DBFileInfo(path='/share/Attachments/1EA9CC59-D0A8-4F82-8054-12DA1DC129C8', isFolder=YES, modified=2015-02-02 10:43:24 +0000, size=0, thumbExists=NO, icon=folder),

1EA9CC59-D0A8-4F82-8054-12DA1DC129C8 is just another level of folders. There are also files at this level too and it has the same issue.

DBFileInfo(path='/share/Attachments/20110131 Bloomberg HP.pdf', isFolder=NO, modified=1979-12-31 07:00:00 +0000, size=868025, thumbExists=NO, icon=page_white_acrobat),

If you notice, "/Share" is what it should be, but it's coming in as "/share" with a lowercase "s" when I fetch the 3rd level of items.

I'm simply calling this code:

NSArray* files = [fileSystem listFolder:path error:outError];

Where "path" = "/Share/Attachments"

Is this a bug on the Dropbox side or something wrong that I'm doing?

It may seem like a small thing, but I'm doing some string searching that's case sensitive and it's throwing off my code. I feel like I'm going to have to add a special case for this in code which will set the case back to "/Share" instead of "/share".

14 Replies

Replies have been turned off for this discussion

About Dropbox API Support & Feedback

Node avatar for Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.

The Dropbox Community team is active from Monday to Friday. We try to respond to you as soon as we can, usually within 2 hours.

If you need more help you can view your support options (expected response time for an email or ticket is 24 hours), or contact us on X, Facebook or Instagram.

For more info on available support options for your Dropbox plan, see this article.

If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!