0

In the Dropbox API v2, File and Folder Metadata contain a path_lower property which specifies the unique path for that file. However, if I have called filesListFolder to retrieve a folder listing, and then need to check whether a path exists in the folder, how do I correctly convert the path to lowercase according to the rules that Dropbox servers use to determine what is a lowercase path. In other words, I don't want to call filesGetMetadata just because the specified path has different casing, but I also don't want to return metadata for the wrong file just because I incorrectly converted it to lowercase.

I'm using the Javascript API.

Arlen Beiler
  • 15,336
  • 34
  • 92
  • 135
  • It sounds like you're essentially asking how to do a case-insensitive string comparison in JavaScript. I.e., you want to compare your own path string against `path_lower`. There's a post for case-insensitive string comparison in JavaScript here: https://stackoverflow.com/questions/2140627/javascript-case-insensitive-string-comparison – Greg Aug 10 '18 at 18:07
  • But the problem is I do not know what standard Dropbox uses to determine caseness. Which codepoints are considered cased and which are not. In other words, I can't just call "mystring".toLowerCase() because it might return a different result than path_lower would based on the user machine locale. – Arlen Beiler Aug 11 '18 at 01:55
  • Dropbox doesn't document the exact lowercasing algorithm it uses, but I'll pass this along as a feature request. – Greg Aug 13 '18 at 14:17

0 Answers0