Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
I'm using Dropbox SDK v2 and I want to delete an item (folder or file) . Is it possible?
Thank you
Which SDK?
Via the HTTP API, it's /files/delete. Search for "delete" here: https://www.dropbox.com/developers-preview/documentation/http#documentation.
Sorry for not mentioning. It's the one for .NET.
In that SDK, the method is called DeleteAsync.
Thanks Steve . It's working dropboxClient.Files.DeleteAsync(path).
I was looking at http://dropbox.github.io/dropbox-sdk-dotnet/html/N_Dropbox_Api_Files.htm ,not at http://dropbox.github.io/dropbox-sdk-dotnet/html/T_Dropbox_Api_Files_Routes_FilesRoutes.htm
Once DeleteAsync method executed, in order to confirm that file is deleted or not i'm using a file meta data flag called isDeleted, but it return false when the file is removed from dropbox folder?
var deleted = await dbx.Files.DeleteAsync(isFound.PathLower);
return deleted.IsDeleted
Arooran, thanks for the report! We'll look into it.
Arooran, I looked into this, and this is the expected behavior. The delete call deletes a file or folder at the specified path. A success response indicates that the item was deleted. The returned metadata will be the metadata for the item that was deleted, but not an "IsDeleted" object (since the deleted version of metadata is less useful anyway).
Gregory, Thanks for quick update. but what does the isDeleted meta data stands for? if the file is deleted it should set to true not false.
This is definitely a little confusing in this case, but isDeleted just tells you if the returned Metadata object is of type DeletedMetdata, and not if the remote file is deleted. The delete method never returns a DeletedMetadata though, so isDeleted won't be true. You should instead use the call successfully completing as the indicator that the delete operation worked.
Hi there!
If you need more help you can view your support options (expected response time for a ticket is 24 hours), or contact us on X or Facebook.
For more info on available support options for your Dropbox plan, see this article.
If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!