cancel
Showing results for 
Search instead for 
Did you mean: 
Announcements
Update: Find information on Dropbox support during COVID-19 here
Close
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted

Cannot delete a folder with a '.' in the middle its name?

Explorer | Level 3

When I use the API to delete a folder with:

 

https://api.dropboxapi.com/2/files/delete_v2

If the path to the folder is:

 

/somepath/mydomain.com

 

The folder will not delete. Interestingly, an empty json string is returned from the Dropbox API server.

 

I am going to call this a bug, because it states in the Dropbox API documentation that folders, that developers should avoid using a . (period) or a space at the end of a file or folder name, but not in the middle of a folder or file name.

 

 

10 Replies 10
Highlighted

Re: Cannot delete a folder with a '.' in the middle its name?

Dropboxer
Dropboxer
Thanks for the report. I can't seem to reproduce this issue though. The /2/files/delete_v2 endpoint is successfully deleting a folder with a period in the middle and returning the expected response for me.

Can you share a sample request/response that isn't working as expected, including response headers? Be sure to redact the access token of course. Thanks in advance!
Highlighted

Re: Cannot delete a folder with a '.' in the middle its name?

Explorer | Level 3
Greg. Thanks for the reply.

When I try & delete:

/somepath/mydomain

It deletes successfully every time.

But, when I try & delete:

/somepath/mydomain.com

It does NOT delete the folder and returns an empty response string. Not even an error or 'status_code' is available, so it is very difficult to debug. Any ideas?

I have repeated the test, at least 50 times, using different folder names, with or without the '.' in the middle of the name, and the results are the same, each time.

So, the problem is, I cannot send you response, because there is none!

Thanks

Charlie
Highlighted

Re: Cannot delete a folder with a '.' in the middle its name?

Explorer | Level 3
Greg. This is my fault. Hidden somewhere in the custom API library, I created, I check for the existence of a filename, by using '.', as a file identifier. I created this library some time ago, and neglected to realise that I might be using folder names with '.' in them. Problem solved...
Highlighted

Re: Cannot delete a folder with a '.' in the middle its name?

Explorer | Level 3
Just out of interest do you have an API directive that only deletes folders. So, that if a file path is sent in by mistake, the request fails?
Highlighted

Re: Cannot delete a folder with a '.' in the middle its name?

Dropboxer
Dropboxer
No, we don't have anything like that, but I'll pass that along as a feature request.
Highlighted

Re: Cannot delete a folder with a '.' in the middle its name?

Explorer | Level 3
Greg. Thanks. Expanding, on my original request. Although, it is possible to check the 'get_metadata' of the path to find out whether the '.tag' is a folder or file, & then send a delete directive, this is a little long winded. It would be great, if Dropbox could add another argument to the 'delete' directive, called 'only_delete_path_of_tag_type', with possible values of 'file' & 'folder'. This would be a really cool feature...
Highlighted

Re: Cannot delete a folder with a '.' in the middle its name?

Helpful | Level 5
{"error":true,"msg":"The token paramter is missing. Cannot authorize API request.","data":[]}
Highlighted

Re: Cannot delete a folder with a '.' in the middle its name?

Dropboxer
Dropboxer

@noornoor12gmal If you're having trouble with the Dropbox API, please open a new thread with the details of the issue. Thanks!

Highlighted

Re: Cannot delete a folder with a '.' in the middle its name?

Dropboxer
Dropboxer

@Charles R.5 I just wanted to follow up on this with two notes:

 

- The team pointed out that if you want to make sure you're deleting a folder, you can specify the folder's "id" as the `path` value for the delete_v2 call

- For the opposite case, where you want to make sure you're deleting a specific file, we added a `parent_rev` parameter to delete_v2.

Work Smarter with Dropbox

The way we work is changing. Share and discover new ways to work smarter with Dropbox in our community.

Sound good? Let's get started.
Who's talking

Top contributors to this post

What do Dropbox user levels mean?
Need more support?