You might see that the Dropbox Community team have been busy working on some major updates to the Community itself! So, here is some info on what’s changed, what’s staying the same and what you can expect from the Dropbox Community overall.

Forum Discussion

nguyenthanhliem's avatar
nguyenthanhliem
New member | Level 2
6 years ago

Error in call to API function "files/download"

I use DropBox API to implement Dropbox in Xamarin.Forms (NET Standard). I upload a file success, but when I download I get this error

Dropbox.Api.BadInputException: Error in call to API function "files/download": Bad HTTP "Content-Type" header: "application/x-www-form-urlencoded". Expecting one of "text/plain", "text/plain; charset=utf-8", "application/octet-stream", "application/octet-stream; charset=utf-8".

using (var client = new DropboxClient(this.AccessToken)) { using (var response = await client.Files.DownloadAsync(file.FilePath + "/" + file)) { var pickedFile = await response.GetContentAsByteArrayAsync(); //FileImagePreview.Source = ImageSource.FromStream(() => pickedFile); } }