public async void Upload(string accessToken, string filename, byte[] content, Action onUploadSuccess) { _logger.Info("set access token"); _dropbox.AccessToken = accessToken; _logger.Info("start uploading to dropbox"); await _dropbox.Upload("", filename, content, onUploadSuccess); }
//[TestMethod] public void UploadTest() { const string folder = ""; const string file = "test.sfs"; byte[] content; using (FileStream fileStream = File.OpenRead("dropboxTest.sfs")) { content = new byte[fileStream.Length]; fileStream.Read(content, 0, (int)fileStream.Length); fileStream.Close(); } var dropboxClient = new DropboxWrapper(); Task task = dropboxClient.Upload(folder, file, content, delegate { }); task.Wait(); }