Client.Files.ListFolderAsync("/Path") return both folders and files under the Dropbox selected path. Is there any way I can query ONLY folders or ONLY files?
No, the ListFolderAsync method corresponds to the /files/list_folder endpoint, which doesn't offer a way to return only files or only folders.
We'll consider this a feature request though.
Related
I am using google Drive api ($files = $drive->files->listFiles ($parameters)) and it seems to return files that are not in folders, how can I access folders and their children and so of.
Files.list returns all files that's contained in your Drive API folder including those within subfolders. I've tried it myself. What maybe happening to you is that you have many files and for you to access the file, you need to use nextPageToken. And make sure you set the pageSize to 50 to display more files at a time.
I have an app which integrates with dropbox, I want the user to select a folder from their dropbox.
I can call '/2/files/list_folder' (https://www.dropbox.com/developers/documentation/http/documentation#files-list_folder) with recursive set to true, and then recursively call it based on the returned cursor. I then filter out any which aren't directories.
But this is a long slow process, and unpredictable given the potential size of some users directory tree on Dropbox.
I know there is a dropbox file select plug in (https://www.dropbox.com/developers/chooser), but I want to make a folder select, with no option to select a file.
What I would like is one api call that returns a list of all directories for a user.
Does this exist with an API method I don't know about? Or is there another widget that allows folder selection?
I've seen this question which just does a recursive api call too, not practically efficient.
The Dropbox API v2 doesn't offer a way to list only folders like that, but we'll consider it a feature request.
Dropbox also doesn't offer a component like the Chooser that allows folder selection, but we'll consider that a feature request as well.
I'm using Dropbox V2 APIs (C#) to get files/folders from Dropbox account. I am able to fetch particular file/folder by using its specific path. I wanted to know whether there is any way I can fetch file/folder by using ID?
This depends on exactly which operation(s) you're referring to. For example, downloading files and getting metadata for files or folders support specifying file IDs:
https://www.dropbox.com/developers/documentation/http/documentation#files-download
https://www.dropbox.com/developers/documentation/http/documentation#files-get_metadata
You would specify the path as a string like "id:a4ayc_80_OEAAAAAAAAAYa".
Searching and listing folders currently do not support this though:
https://www.dropbox.com/developers/documentation/http/documentation#files-list_folder
https://www.dropbox.com/developers/documentation/http/documentation#files-search
The same applies to the corresponding methods in the SDKs.
Edit: list_folder and search now do support file IDs.
I am integrating Dropbox in my application. I am able to retrieve child folders of a folder in Dropbox using "https://api.dropboxapi.com/2/files/list_folder" web service. But the data that is being returned doesn't contain size data for folders. Is there any way to retrieve size data for folders in Dropbox?
No, the Dropbox API doesn't report the size of a folder. You would need to compute it yourself, presumably by using /list_folder (with "recursive": true). I'm assuming the definition you have in mind is "the sum of the sizes of all files contained within the folder, recursively."
I wanna try OneDrive Api for Android and I was taking a look at the methods and possibilities this Api offers on this link and this other one but I don't see any way of listing the files a folder contains.
My App would need to upload some files to OneDrive, always using the same folder as root, say /MyFolder. The problem is that it only knows this root folder and all its content must be found out by means of recursive calls, that is, I list the files contained in /MyFolder and check if it's a folder or a file and in the first case list the files again it contains and so on.
Am I missing something or this Api doesn't provide such thing?
The Json object returned for a query against a Folder should contain a "data" property that is an array of children for the folder. You can see this in the interactive SDK (http://isdk.dev.live.com/dev/isdk/default.aspx) by playing with the "Reading Folder Properties" API.