My code for uploading a file to Dropbox is super simple... but it never returns from the call to UploadAsync... the file actually ends up in Dropbox perfectly, but it never returns from the function call... any idea what I might be doing wrong?
using Dropbox.Api;
using Dropbox.Api.Files;
using System;
using System.IO;
using System.Threading.Tasks;
namespace Test
{
public static class DropboxService
{
private static string DropboxAccessToken = "...";
public async static Task<bool> UploadFile(Stream stream, string path, string filename)
{
using (var client = new DropboxClient(DropboxAccessToken))))
{
var updated = await client.Files.UploadAsync(
Path.Combine(path, filename),
WriteMode.Overwrite.Instance,
body: stream);
// never returns from UploadAsync
}
return true;
}
}
}
UploadAsync
isn't returning? You don't seem to be using the return valueupdated
.