cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
We are making some updates so the Community might be down for a few hours on Monday the 11th of November. Apologies for the inconvenience and thank you for your patience. You can find out more here.

Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

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

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

Brendan D.
Explorer | Level 4

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 14

Behroz S.
New member | Level 1

I have also run into this exact same issue which has caused me to develop a very inefficient work around in IOS which is prone to bugs.

Gregory, you mentioned that you would request an improvement to this issue back in February and I was wondering if this is something Dropbox will ever fix?

Thanks for any insight!

Greg-DB
Dropbox Staff

Unfortunately I don't have an update on if or when we'll be able to improve this on our side. Sorry I don't have anything better to share!

Steve M.
Dropbox Staff

This specific thread is about the Sync API, which is deprecated, so we won't be making changes to it.

More generally, /delta (API v1) and /files/list_folder (API v2) behave similarly in that only the last path segment is "correctly" cased (according to the current casing of the file). There are no immediate plans to change that, so my advice is to treat the Dropbox API as case-insensitive, since it is.

For the scenario raised here, of trying to locate files on the local file system, the only good way to do this is to maintain your own mapping of lowercased paths to cased paths in the local file system. Because Dropbox itself is case insensitive, if we returned you a fully cased path, it may still not match the local file system. E.g. you wrote a file called Hello.txt and uploaded it to Dropbox as Hello.txt. The user then renamed it to HELLO.TXT. Now if the API told you the path was HELLO.TXT, you wouldn't be able to find the file on the local file system, where no such file exists. If instead, your app kept track of "Hello.txt is the local path for /hello.txt in Dropbox," there would be no such problem.

So although we may revisit over time returning different information about the current casing of a file path in Dropbox, the fact that Dropbox itself is case-insensitive means that your app will need to maintain its own mapping when dealing with something like a case-sensitive file system.

testaccountprim
New member | Level 1

Actually i have an sync app for dropbox api. When i put request for a folder named TEST, it replies with the content of folder named test ...(i know dropbox is case insensitive).but i need to resolve...either u have options ? or i have to handle this?

Greg-DB
Dropbox Staff

Hi "testaccountprimary", this is an old thread about the Sync SDK in particular. It's unclear if that's what you're referring to, so please open a new thread with additional details so we can help you without spamming the other people on this thread. Thanks!

Need more support?
Who's talking

Top contributors to this post

  • User avatar
    Greg-DB Dropbox Staff
  • User avatar
    testaccountprim New member | Level 1
  • User avatar
    Steve M. Dropbox Staff
  • User avatar
    Behroz S. New member | Level 1
What do Dropbox user levels mean?