'Get File Timestamp from Dropbox
I have the following code:
private static void Download(DropboxClient client, string dropboxfolder, string localfolder, FileMetadata file)
{
//Console.WriteLine("Download file...");
var task1 = client.Files.DownloadAsync(dropboxfolder + "/" + file.Name);
task1.Wait();
using (var response = task1.Result)
{
Console.WriteLine("Downloaded {0} Rev {1}", response.Response.Name, response.Response.Rev);
Console.WriteLine("------------------------------");
using (Stream output = File.OpenWrite(Path.Combine(localfolder, response.Response.Name)))
{
var task2 = response.GetContentAsStreamAsync();
task2.Wait();
using (Stream input = task2.Result)
{
input.CopyTo(output);
}
}
Console.WriteLine("------------------------------");
}
}
how do I modify it such that the output
file will have the same timestamp as the file in dropbox.
[EDIT] I know how to set a date of a file in C#, but I don't know how to get that timestamp from dropbox in order to call that method. The question I am asking is more generic than that because perhaps there is an option on the dropbox API that allows the file to be set by dropbox.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|