cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Want to learn some quick and useful tips to make your day easier? Check out how Calvin uses Replay to get feedback from other teams at Dropbox here.

Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Re: Delete file from dropbox

Delete file from dropbox

Nenciu D.
New member | Level 1

I'm using Dropbox SDK v2 and I want to delete an item (folder or file) . Is it possible?

Thank you

9 Replies 9

Steve M.
Dropbox Staff

Which SDK?

Via the HTTP API, it's /files/delete. Search for "delete" here: https://www.dropbox.com/developers-preview/documentation/http#documentation.

Nenciu D.
New member | Level 1

Sorry for not mentioning. It's the one for .NET.

Steve M.
Dropbox Staff

In that SDK, the method is called DeleteAsync.

Nenciu D.
New member | Level 1

arooran s.
New member | Level 1

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

Greg-DB
Dropbox Staff

Arooran, thanks for the report! We'll look into it.

Greg-DB
Dropbox Staff

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).

arooran s.
New member | Level 1

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.

Greg-DB
Dropbox Staff

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. 

Need more support?