Your workflow is unique 👨‍💻 -  tell us how you use Dropbox here.

Forum Discussion

rhernandez8305's avatar
rhernandez8305
Helpful | Level 6
8 years ago

Recently modified Direcories or files

How can I know if a directory or files has been modify before download it.

5 Replies

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Community Moderator rankDropbox Community Moderator
    8 years ago

    The best way to keep track of changes in folders via the API is to use the /2/files/list_folder[/continue] endpoints. By storing and re-using the latest cursor you received and calling back to /2/files/list_folder/continue when desired, you can see just what changed, if anything. The documentation for those endpoints contains more information.

     

    For reference, there are corresponding native methods for those endpoints in the official SDKs, such as ListFolder and ListFolderContinue in the .NET SDK, for example.

  • rhernandez8305's avatar
    rhernandez8305
    Helpful | Level 6
    8 years ago

    Thanks for reply! I had test the functions but the cursor value change in each request, just the files' hash value is the same. With the files' hash value I know if the file changed but the dictories I don't know how do it, the directories doesn´t have hash value.

     

    Thanks.

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Community Moderator rankDropbox Community Moderator
    8 years ago
    What kind of "change" for the folder are you looking for exactly? By storing and re-using the latest cursor you received, you can get any/all changes in the folder. If you want to receive changes in subfolders too, set recursive=true.
  • rhernandez8305's avatar
    rhernandez8305
    Helpful | Level 6
    8 years ago

    Did you have an example, I got a diferent cursor value in each request although the folder don´t have changes.

     

    var list3 = await dbx.Files.ListFolderAsync(string.Empty);

     

    first request

    list3.Cursor =  AAG88yckZh...

     

    second request

    list3.Curso=AAHI9m7iCl...

     

    never is the same cursor value.

     

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Community Moderator rankDropbox Community Moderator
    8 years ago
    You will get a different cursor each time, but the cursor itself doesn't tell you about the contents anyway. You should refer to the 'entries' list in the response to see what, if anything, changed under that folder.

About Dropbox API Support and Feedback

Node avatar for Dropbox API Support and Feedback
Get help with the Dropbox API from fellow developers and experts.

The Dropbox Community team is active from Monday to Friday. We try to respond to you as soon as we can, usually within 2 hours.

If you need more help you can view your support options (expected response time for an email or ticket is 24 hours), or contact us on X, Facebook or Instagram.

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!