A few notes on: SkyDrive .Net API Client 2.0.3b

Mar 18, 2013 at 7:28 PM
Hey all,

A few notes/corrections that I stumbled upon as I am working with the 2.0.3b:
  1. If you are trying to download/upload to one of the "stock root" folders like: 'Documents" or Camera Roll" etc, you need to uncomment out lines 120 - 127 and 129-131 in SkyDriveServiceClient.Helper.cs:
sb.Replace("^", "^L")
           .Replace("+", "^M")
           .Replace("/.", "/^.")
           .Replace("&", "^0")
           .Replace("#", "^N")
           .Replace("%", "^1")
           .Replace("(", "^5")
           .Replace(")", "^6")
           //.Replace("_", "^_")
           .Replace("'", "^4")
           .Replace(",", "^J")
           .Replace("~", "^F");
You'll note that lines 238 remains commented out. This prevent files that contained an underscore in the name to be properly downloaded. May be able to use the HttpUtility.UrlEncode for the path, but I haven't dug into that yet.
  1. If you wish to download files that have filenames with foreign characters (like Japanese, or Greek, etc) you will need to modify PassportClient.cs, line 69 to use the AbsoluteUri as opposed to the basic RequestUri:

If you don't do this, webRequest2.Headers[HttpRequestHeader.Authorization] = challengeResponse;

will bomb out with an invalid value error due to improper encoding.