We're making changes to the Community, so you may have received some notifications - thanks for your patience and welcome back. Learn more here.

Forum Discussion

devLander's avatar
devLander
Explorer | Level 3
6 years ago

Get revision of file from C#

Hello, I need to keep syncronized in the memory of my program the contents of a file inside my dropbox, I was thinking on getting constantly the Revision of that file and if it's different, then, download the content. Ignoring if that's the best way to go. It's a really light file, less than 10KB of text.

So, I was thinking this way, in a timer:

            if (!workingAsync)
            {
                workingAsync = true;
                string newRev = (await dBox.Files.GetMetadataAsync("/File.txt")).AsFile.Rev;
                workingAsync = false;

                if (oldRev != newRev)
                {
                    oldRev = newRev;
                    DownloadUpdatedFile();
                }
            }

But I don't know if there's a better way of performing this check.

Thanks for any advice.

 

About Dropbox API Support & Feedback

Node avatar for Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

5,875 PostsLatest Activity: 2 months ago
325 Following

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 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!