private void btlUpload_Click(object sender, RoutedEventArgs e) { try { if (DBB != null) { if (strAccessToken != null && strAuthenticationURL != null) { DBB.Upload("Dropbox/DotNetApi/DLClaim", "Sample", @"D:\Untitled.PNG"); } } } catch (Exception) { throw; } }
public bool Upload(string UploadfolderPath, string UploadfileName, string SourceFilePath) { try { using (var stream = new MemoryStream(File.ReadAllBytes(SourceFilePath))) { var response = DBClient.Files.UploadAsync("/" + UploadfolderPath + "/" + UploadfileName, WriteMode.Overwrite.Instance, body: stream); var rest = response.Result; //Added to wait for the result from Async method } return true; } catch (Exception ex) { return false; } }
using Dropbox.Api;
I tried to upload a file to Dropbox (like google Drive). but did not find anything appropriate.
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)