Search code examples
windows-8windows-store-appswinjs

WinJS getFolderAsync with path parameter


So the documentation for StorageFolder.GetFolderAsync says that the String parameter can be the name or the path relative to the current folder of the sub-folder to retrieve.

I can get the name to work just fine, but not the relative paths, e.g. for "localFolder/myFolder/mySubFolder/":

localFolder.getFolderAsync("myFolder/mySubFolder" or "/myFolder/mySubFolder").done( /* Your success and error handlers */ );

It works just fine if I chain getFolderAsync("myFolder") and getFolderAsync("mySubFolder").

What am I doing wrong?


Solution

  • add path like "Screenshots\Screenshot (3).png" example:

     localFolder.getFolderAsync("Screenshots\\Screenshot (3).png").done()