0

I have written a small method that uploads files on Dropbox and that method is working absolutely fine but the issue is how can I get the URL of the uploaded image so that I hit that URL on browser and it shows me the image. Here is the code of uploading files:

 public static async Task Run()
        {
            var accessToken = ConfigurationManager.AppSettings["DropBoxAccessToken"];
            using (var dbx = new DropboxClient(accessToken))
            {
                //var full = await dbx.Users.GetCurrentAccountAsync();
                await Upload(dbx, "/Test", "Test Image.jpg");
            }
        }

        static async Task Upload(DropboxClient dbx, string folder, string file)
        {
            var readContent = System.IO.File.ReadAllBytes(@"D:\Images\IMG_20161127_204200968.jpg");
            using (var mem = new MemoryStream(readContent))
            {
                var updated = await dbx.Files.UploadAsync(
                    folder + "/" + file,
                    WriteMode.Overwrite.Instance,
                    body: mem);
                var mediaInfo = updated.MediaInfo;
            }
        }

I have tried to get details of uploaded image by hovering on var updated but didn't get the URL.

Any help?

Greg
  • 16,359
  • 2
  • 34
  • 44
diamond421
  • 137
  • 1
  • 2
  • 12

1 Answers1

0

To get a link to a file via the Dropbox API, you have two options:

Greg
  • 16,359
  • 2
  • 34
  • 44