cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Are you an educator? Well we want to hear from you, so check out some tools we think might help you out 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: 

Is it possible to set client_modified on an existing file in v2 API?

Is it possible to set client_modified on an existing file in v2 API?

ncw
Helpful | Level 5

Being able to set client_modified on an existing file would be really helpful for rclone.

I looked through the API methods and couldn't see a way but I'm hoping I missed it!

Thanks

 

Nick

1 Accepted Solution

Accepted Solutions

Re: Is it possible to set client_modified on an existing file in v2 API?

Greg-DB
Dropboxer
Just to be clear, I've sent this feature request along, but I can't promise if/when it might be implemented.

View solution in original post

9 Replies 9

Re: Is it possible to set client_modified on an existing file in v2 API?

Alexandra F.1
New member | Level 1

It's not currently possible to override the client_modified value set by the client using the API, but I'll be sure to pass this along as a feature request.

Re: Is it possible to set client_modified on an existing file in v2 API?

bliang
New member | Level 2

Is there any update on this feature request?

Re: Is it possible to set client_modified on an existing file in v2 API?

Greg-DB
Dropboxer

The upload endpoints, such as /2/files/upload, do now allow you to explicitly set `client_modified` when uploading a new version of a file. 

 

For reference, do you need to be able to do so without uploading a new version?

Re: Is it possible to set client_modified on an existing file in v2 API?

ncw
Helpful | Level 5

> For reference, do you need to be able to do so without uploading a new version?

 

Yes that would be ideal.

 

Rclone uses `client_modified` to save the modification times of files.  If a user just does `touch file` then it would be nice to be able to just set the `client_modified` without upload the whole file again.

 

At the moment rclone will upload the whole file again just to set the modification time which is a bit wasteful.  Perhaps there is a better way?

 

Thanks

 

Nick

Re: Is it possible to set client_modified on an existing file in v2 API?

Greg-DB
Dropboxer

@ncw Thanks for the context! There isn't a way to that on the Dropbox API unfortunately, but I'll send it along as a feature request.

Re: Is it possible to set client_modified on an existing file in v2 API?

ncw
Helpful | Level 5

Related to that...  If you actually want to upload a the same file with a different `client_modified`, you have to delete the existing file first.

 

If you don't delete the existing file first, then the upload succeeds, but somehow it has the old `client_modified`, not the new one you just specified in your upload.

 

I suspect this is upload process checking the hash and noting that the file content is the same after the upload and deciding not to do anything further with the data.

 

You can work around this by deleting the file first (which is what rclone does) but this isn't ideal as it makes data loss more likely if the transfer of the new file fails.

 

I'm not sure whether this is part of the same feature request, or whether it it a seperate bug report!

 

If you think it should be a bug report I'm happy to write it up in more detail with some HTTP API transactions to show exactly what is going on.

 

Thanks

 

Nick

Re: Is it possible to set client_modified on an existing file in v2 API?

Greg-DB
Dropboxer

@ncw That behavior is expected. From the /2/files/upload WriteMode docs:

 

"If the target path refers to a file with identical contents, nothing gets written; no conflict."

Re: Is it possible to set client_modified on an existing file in v2 API?

ncw
Helpful | Level 5

I see - thank you for explaining. I don't like this design choice, but it is documented so I'll live with it 🙂

 

Looking forward to an API to set the client_modified time!

 

Thanks for your help @Greg-DB

Re: Is it possible to set client_modified on an existing file in v2 API?

Greg-DB
Dropboxer
Just to be clear, I've sent this feature request along, but I can't promise if/when it might be implemented.

View solution in original post

Poll
We love to learn from the educators who use Dropbox. Whether you teach kids, teens, adults or a combination of all three, we want to know what apps and integrations you use with Dropbox to help with teaching. Which of the ones below is your favorite, or most used tool?
Who's talking

Top contributors to this post

  • User avatar
    Greg-DB Dropboxer
  • User avatar
    ncw Helpful | Level 5
What do Dropbox user levels mean?
Need more support?