dropbox-sdk-dotnet
dropbox-sdk-dotnet copied to clipboard
how to verify downloaded file?
hello again, here is my code that I use to download a file:
using (var response = await client.Files.DownloadAsync(file.AsFile.PathDisplay))
{
File.WriteAllBytes(folder + "/" + realName, await response.GetContentAsByteArrayAsync());
}
but my question is: how can I check if the downloaded file is correct? is there a checksum or md5 or someother thing?
thanks in advance
The Dropbox API doesn't currently offer any sort of hash or checksum, but I'll be sure to pass this along as a feature request. If the download is interrupted though, an exception will be thrown.
:+1: thanks @greg-db
Hi, What news this issues? Thx.
Recently, the API "FileMetadata" objects got a new "content_hash" field.
- More information about that field: https://www.dropbox.com/developers/reference/content-hash
- C# code to compute the hash: https://github.com/dropbox/dropbox-api-content-hasher/tree/master/csharp
thx @cakoose it's very good. May be add DropboxContentHasher in sdk?
Thanks Andrew! I can't make any promises, but we'll keep this open as a request to integrate that directly into the SDK.