We are aware of the issue with the badge emails resending to everyone, we apologise for the inconvenience - learn more here.

Forum Discussion

MartaMarco1972's avatar
MartaMarco1972
Explorer | Level 3
8 years ago

using c# for upload text file

I'm trying to upload a text file to my account, but something I'ts wrong

 

static async Task Run()
{
	using (var dbx = new DropboxClient("MYTOKEN"))
	{
		var file = "list.txt";
		var folder = "/Users/user01/Downloads/";
		var lastpath = folder + file;
		var mem = new MemoryStream(File.ReadAllBytes(@"C:\Users\user01\Downloads\list.txt"));
		var upload = await dbx.Files.UploadAsync(lastpath, Dropbox.Api.Files.WriteMode.Overwrite.Instance, false, null, false, mem);
		Console.WriteLine(upload);
 
		Console.ReadLine();
	}
}

 

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Staff rankDropbox Staff

    What error message do you get when you run your code?

      • Greg-DB's avatar
        Greg-DB
        Icon for Dropbox Staff rankDropbox Staff
        If there isn't an exception being raise with some error, the method should be returning. You're saving the output to `upload`. Can you share the output from `Console.WriteLine(upload);` in that case?