There have been many instances when one required to upload the document to the document library in a particular folder. If one have noticed that while uploading the document to document library we get a browse option which let one to select the folder to add the document in library.
To achieve this sharepoint uses the LaunchPickerTreeDialog method this can be found in /_layouts/1033/PickerTreeDialog.js file under 14 hive folder. This is used to display the site content and filter the content based on the WebOnly, listOnly, WebAndLIsts and websAndListFolders.